[SERVER-84155] Add document checks for BSONColumn DocDiff application Created: 13/Dec/23  Updated: 19/Jan/24

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Gregory Wlodarek Assignee: Backlog - Storage Execution Team
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-79416 Generate and apply the BSONColumn Doc... Open
Assigned Teams:
Storage Execution
Participants:

 Description   

This ensures the bucket document wasn't changed underneath us while generating the DocDiff from something like a direct write or synchronization bug in the BucketCatalog. This mechanism protects against data corruption.

Rough draft of how we can achieve this:

  • When committing a WriteBatch
    • We have a Struct {anchor, preImageBytes, postImageBytes}. The bytes are after the anchor point
    • Before inserting measurements into the builders, set the anchor and preImageBytes for each data field
    • Insert measurements into the builders from the WriteBatch
    • Set the postImageBytes
  • Generate the DocDiff using the anchor as o(ffset) and postImageBytes as d(ata)
  • Pass this DocDiff into UpdateCommandRequest with preImageBytes.
    • In the query layer, we check that the current bucket document preImageBytes match after the anchor

This is a primary only check


Generated at Thu Feb 08 06:54:12 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.