Skip to content

Conversation

@gregns1
Copy link
Contributor

@gregns1 gregns1 commented Aug 8, 2025

CBG-4798

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 August 8, 2025 15:25
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 adds a test to verify that Hybrid Logical Vector (HLV) metadata is properly generated when documents are written through the rev ID replicator pathway. This test replaces similar functionality that was removed in PR #7668 when the active replicator stopped using protocol versions < 4.

  • Add TestHLVUpdateOnRevReplicatorPut test function to verify HLV generation
  • Test uses PutNewEditsFalse to simulate replicator write behavior
  • Assertions verify HLV fields are correctly populated with source ID, version, and CAS values

@gregns1 gregns1 requested a review from bbrks August 8, 2025 15:28
Comment on lines +3243 to +3245
assert.Equal(t, rt.GetDatabase().EncodedSourceID, syncData.HLV.SourceID)
assert.Equal(t, base.HexCasToUint64(syncData.Cas), syncData.HLV.Version)
assert.Equal(t, base.HexCasToUint64(syncData.Cas), syncData.HLV.CurrentVersionCAS)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you want to note in that we should have PutNewEditsFalse to make sure HLV is updated in #7658 or one of the tickets?

Do you think there's a difference between doing this with a REST api vs blip?

Copy link
Member

Choose a reason for hiding this comment

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

Me and Greg synced up this morning on this which is how this ended up getting a new test written.

We intentionally do not want to have PutNewEditsFalse write a CV here. This is testing legacy rev handling. This is the same codepath as a 3.x BLIP replicator via PutExistingRevWithConflictResolution

@gregns1 gregns1 merged commit beafea8 into main Aug 11, 2025
44 checks passed
@gregns1 gregns1 deleted the CBG-4798 branch August 11, 2025 09:00
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.

4 participants