CBG-5397: On-demand import should consider mou when updating HLV#8349
Open
RIT3shSapata wants to merge 1 commit into
Open
CBG-5397: On-demand import should consider mou when updating HLV#8349RIT3shSapata wants to merge 1 commit into
RIT3shSapata wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates on-demand import read paths to ensure metadata-only update (MOU) state and rev-seq information are available when reloading documents prior to import, preventing incorrect HLV/MOU updates. Adds targeted test coverage to catch regressions around _mou and PreviousRevSeqNo population.
Changes:
- Update
GetDocumentWithRawreload to request_mouand$document.revidalongside existing SG xattrs. - Update
GetDocSyncDatato fetch$document.revid(and_mou) so on-demand import can populateMetadataOnlyUpdate.PreviousRevSeqNocorrectly. - Add tests validating
_mouis included in the reload path and thatGetDocSyncData-triggered import sets correct MOUpRev.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| db/import_test.go | Adds regression tests covering _mou presence during reload and correct PreviousRevSeqNo after on-demand import triggered by GetDocSyncData. |
| db/crud.go | Expands xattr keysets used during on-demand import-related reads to include _mou and $document.revid. |
| @@ -86,7 +86,7 @@ func (c *DatabaseCollection) GetDocumentWithRaw(ctx context.Context, docid strin | |||
| // If existing doc wasn't an SG Write, import the doc. | |||
| if !isSgWrite { | |||
| // reload to get revseqno for on-demand import | |||
Comment on lines
+286
to
+288
| // rawBucketDoc.Xattrs reflects the pre-import state fetched at the reload step. | ||
| // Without the fix, _mou was absent from the reload xattr list, so this would be nil | ||
| // even though the bucket has a _mou xattr from the first import. |
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-5397
Describe your PR here...
Pre-review checklist
fmt.Print,log.Print, ...)base.UD(docID),base.MD(dbName))docs/apiDependencies (if applicable)
Integration Tests