Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions db/background_mgr_attachment_migration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func TestAttachmentMigrationTaskMixMigratedAndNonMigratedDocs(t *testing.T) {
require.NoError(t, err)

// wait for task to complete
RequireBackgroundManagerState(t, ctx, attachMigrationMgr, BackgroundProcessStateCompleted)
RequireBackgroundManagerState(t, attachMigrationMgr, BackgroundProcessStateCompleted)

// assert that the subset (5) of the docs were changed, all created docs were processed (10)
stats := getAttachmentMigrationStats(t, attachMigrationMgr.Process)
Expand Down Expand Up @@ -118,7 +118,7 @@ func TestAttachmentMigrationManagerResumeStoppedMigration(t *testing.T) {
}
}()

RequireBackgroundManagerState(t, ctx, attachMigrationMgr, BackgroundProcessStateStopped)
RequireBackgroundManagerState(t, attachMigrationMgr, BackgroundProcessStateStopped)

stats := getAttachmentMigrationStats(t, attachMigrationMgr.Process)
require.Less(t, stats.DocsProcessed, int64(4000))
Expand All @@ -132,7 +132,7 @@ func TestAttachmentMigrationManagerResumeStoppedMigration(t *testing.T) {
err = attachMigrationMgr.Start(ctx, nil)
require.NoError(t, err)

RequireBackgroundManagerState(t, ctx, attachMigrationMgr, BackgroundProcessStateCompleted)
RequireBackgroundManagerState(t, attachMigrationMgr, BackgroundProcessStateCompleted)

stats = getAttachmentMigrationStats(t, attachMigrationMgr.Process)
require.GreaterOrEqual(t, stats.DocsProcessed, int64(4000))
Expand Down Expand Up @@ -169,7 +169,7 @@ func TestAttachmentMigrationManagerNoDocsToMigrate(t *testing.T) {
require.NoError(t, err)

// wait for task to complete
RequireBackgroundManagerState(t, ctx, attachMigrationMgr, BackgroundProcessStateCompleted)
RequireBackgroundManagerState(t, attachMigrationMgr, BackgroundProcessStateCompleted)

// assert that the two added docs above were processed but not changed
stats := getAttachmentMigrationStats(t, attachMigrationMgr.Process)
Expand Down Expand Up @@ -227,7 +227,7 @@ func TestMigrationManagerDocWithSyncAndGlobalAttachmentMetadata(t *testing.T) {
require.NoError(t, err)

// wait for task to complete
RequireBackgroundManagerState(t, ctx, attachMigrationMgr, BackgroundProcessStateCompleted)
RequireBackgroundManagerState(t, attachMigrationMgr, BackgroundProcessStateCompleted)

// assert that the two added docs above were processed but not changed
stats := getAttachmentMigrationStats(t, attachMigrationMgr.Process)
Expand Down
5 changes: 4 additions & 1 deletion db/background_mgr_resync_dcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,10 @@ func (r *ResyncManagerDCP) Run(ctx context.Context, options map[string]any, pers
for _, databaseCollection := range db.CollectionByID {
collectionNames = append(collectionNames, databaseCollection.ScopeAndCollectionName())
}
db.invalidateAllPrincipals(ctx, collectionNames, endSeq)
err = db.invalidateAllPrincipals(ctx, collectionNames, endSeq)
if err != nil {
return fmt.Errorf("Could not invalidate principal documents: %w", err)
}

}

Expand Down
Loading
Loading