Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates metadata migration behavior so that _sync:-prefixed documents with unrecognised prefixes no longer cause the migration job to fail or retry until max passes. Instead, migration completion is gated only on per-document move/delete errors, while unknown-prefix keys are left in place and surfaced via logging and stats for observability.
Changes:
- Stop treating unknown-prefix fallback keys as a completion blocker; complete migration when
stats.Errors == 0. - Add an end-of-run warning when completing with unknown-prefix keys still present on the fallback.
- Update unit test expectations and Prometheus/stat descriptions to match the new policy.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| db/metadata_migration.go | Updates MigrateMetadata function comment to reflect new semantics for the returned “remaining” count (unknown-prefix only). |
| db/background_mgr_metadata_migration.go | Changes completion gating to ignore unknown-prefix count; adds warning on completion with leftovers; adjusts give-up error message. |
| db/background_mgr_metadata_migration_test.go | Updates test to assert migration completes successfully even when an unknown-prefix _sync: doc remains on fallback. |
| base/stats_descriptions.go | Updates stat description to clarify unknown-prefix keys do not block completion. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
adamcfraser
reviewed
Jun 12, 2026
adamcfraser
left a comment
Collaborator
There was a problem hiding this comment.
Posted a question offline on the timing of this change - let's discuss.
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.
CBG-5443
Simple change to not fail migration job when unknown prefixes are in the bucket during migration. Logging remains in place for these prefixes and will log extra warning at end of job if we have keys remaining. Loop in place for errors during the migration run.
Pre-review checklist
fmt.Print,log.Print, ...)base.UD(docID),base.MD(dbName))docs/apiDependencies (if applicable)
Integration Tests