Skip to content

CBG-5397: On-demand import should consider mou when updating HLV#8349

Open
RIT3shSapata wants to merge 1 commit into
mainfrom
CBG-5397
Open

CBG-5397: On-demand import should consider mou when updating HLV#8349
RIT3shSapata wants to merge 1 commit into
mainfrom
CBG-5397

Conversation

@RIT3shSapata

Copy link
Copy Markdown
Contributor

CBG-5397

Describe your PR here...

  • change the xattr keys used by GetDocumentWithRaw and GetDocSyncData
  • Add test coverage

Pre-review checklist

  • Removed debug logging (fmt.Print, log.Print, ...)
  • Logging sensitive data? Make sure it's tagged (e.g. base.UD(docID), base.MD(dbName))
  • Updated relevant information in the API specifications (such as endpoint descriptions, schemas, ...) in docs/api

Dependencies (if applicable)

  • Link upstream PRs
  • Update Go module dependencies when merged

Integration Tests

@RIT3shSapata RIT3shSapata requested a review from adamcfraser June 9, 2026 12:37
Copilot AI review requested due to automatic review settings June 9, 2026 12:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 GetDocumentWithRaw reload to request _mou and $document.revid alongside existing SG xattrs.
  • Update GetDocSyncData to fetch $document.revid (and _mou) so on-demand import can populate MetadataOnlyUpdate.PreviousRevSeqNo correctly.
  • Add tests validating _mou is included in the reload path and that GetDocSyncData-triggered import sets correct MOU pRev.

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.

Comment thread db/crud.go
@@ -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 thread db/import_test.go
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants