Skip to content

Conversation

@gregns1
Copy link
Contributor

@gregns1 gregns1 commented Jan 28, 2026

CBG-5141

  • Exposed by running new added tests with bypass rev cache
  • Fetch backup revision when fetching by Cv only for delta source cases. Return not found otherwise

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

Copilot AI review requested due to automatic review settings January 28, 2026 13:55
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug where the HLV (Hybrid Logical Vector) was incorrectly assigned when fetching backup revisions, potentially resulting in wrong current version (CV) and history for a given revision. The fix ensures that doc.HLV is only assigned when the fetched CV matches the document's current version.

Changes:

  • Modified revCacheLoaderForDocumentCV to conditionally assign HLV only when the fetched CV matches the current version
  • Removed incorrect CV assignment in BypassRevisionCache.GetWithCV
  • Added test coverage to verify correct HLV behavior when fetching backup revisions

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
db/revision_cache_test.go Adds test to verify HLV is correctly populated when fetching backup revisions
db/revision_cache_interface.go Moves HLV assignment inside conditional block to only assign when CV matches current version
db/revision_cache_bypass.go Removes incorrect CV assignment that was overwriting the fetched CV

@gregns1 gregns1 requested a review from bbrks January 28, 2026 14:00
@gregns1 gregns1 changed the title CBG-5141: assign doc.HLV only for CV fetches CBG-5141: Only fetch backup revision for fromRev for delta sync Jan 29, 2026
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