Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors sharded DCP-related code to share common collection-name handling between import and resync, and tightens some resync manager option validation.
Changes:
- Introduces
base.CollectionNames(+ helpers) and migrates resync request/test usage to it. - Adds resync manager option type-checking to avoid panics on invalid options.
- Moves import DCP correlation logging context setup back into the import listener and centralizes some DB context helpers (scope name, sharded DCP capability, collection name aggregation).
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| rest/indextest/index_test.go | Updates resync payload construction to use base.NewCollectionNames. |
| rest/api.go | Changes resync POST request body type for scopes to base.CollectionNames. |
| rest/adminapitest/collections_admin_api_test.go | Updates admin API resync tests to use base.NewCollectionNames. |
| db/import_listener.go | Refactors import feed startup to use shared helpers and sharded DCP decision logic. |
| db/database.go | Adds scopeName, useShardedDCP(), and collectionNames() helpers; enforces single-scope DB config. |
| db/background_mgr_resync_dcp_test.go | Updates resync DCP manager tests to pass base.CollectionNames. |
| db/background_mgr_resync_dcp.go | Switches resync collection tracking to base.CollectionNames and adds option validation. |
| base/dcp_sharded.go | Removes correlation ID context assignment from sharded DCP startup; updates comment wording. |
| base/collection_common.go | Adds CollectionNames type and helper methods for common scope/collection mapping. |
4 tasks
RIT3shSapata
previously approved these changes
Feb 23, 2026
1c26ac2 to
d97c3fc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Creates common code for sharded DCP to share between import and resync.
CollectionNamesstruct for common use. This type already exists insgbucket.FeedArgumentsand probably could be pushed to sg-bucket in the future. It would probably be better to have a type that ismap[string]map[string]{}structin the future.ctx = CorrelationIDLogCtx(ctx, DCPImportFeedID)back to import listener in preparation for resync usagePre-review checklist
fmt.Print,log.Print, ...)base.UD(docID),base.MD(dbName))docs/apiIntegration Tests
GSI=true,xattrs=truehttps://jenkins.sgwdev.com/job/SyncGatewayIntegration/0000/