Skip to content

Conversation

@torcolvin
Copy link
Collaborator

@torcolvin torcolvin commented Nov 19, 2025

NOTE: This may be superseded by #7892 , but this would be a very low risk way to fix resync in 4.0.2

Resync: make sure to create HLV if non exists

This fixes the error message:

Error updating doc %s: _vv: nil xattr value not allowed 

and allows a legacy rev to be resynced.

NOTE: do not merge yet, might fix as part of CBG-3690.

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 November 19, 2025 21:03
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 resyncing a legacy document (one without an HLV) would fail with a "nil xattr value not allowed" error. The fix ensures that an HLV is created during the resync operation if one doesn't already exist.

Key Changes:

  • Added call to updateHLV in the resync operation to create HLV when missing
  • Enhanced test coverage to verify resync works for both legacy docs (without HLV) and modern docs (with HLV)

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
db/database.go Added HLV creation during document resync operation
db/database_test.go Extended test to cover both pre-4.0 (no HLV) and post-4.0 (has HLV) scenarios

@torcolvin torcolvin changed the title Resync: make sure to create HLV if non exists [tentative 4.0.2 backport fix] Resync: make sure to create HLV if non exists Nov 20, 2025
@torcolvin torcolvin changed the title [tentative 4.0.2 backport fix] Resync: make sure to create HLV if non exists [4.0.2] CBG-5017 Resync: make sure to create HLV if non exists Nov 26, 2025
@torcolvin torcolvin changed the base branch from main to release/4.0.2 November 26, 2025 16:39
@torcolvin torcolvin changed the base branch from release/4.0.2 to main November 26, 2025 16:40
@torcolvin torcolvin changed the title [4.0.2] CBG-5017 Resync: make sure to create HLV if non exists CBG-5017 Resync: make sure to create HLV if non exists Nov 26, 2025
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