[SERVER-47752] kMajorityCommitted ReadSource should not have special treatment in RecoveryUnit Created: 24/Apr/20  Updated: 29/Oct/23  Resolved: 26/Oct/20

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

Type: Improvement Priority: Major - P3
Reporter: Louis Williams Assignee: Brian DeLeonardis (Inactive)
Resolution: Fixed Votes: 0
Labels: newgrad
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2020-10-19, Execution Team 2020-11-02
Participants:

 Description   

kMajorityCommitted is special in that it requires a call to obtainMajorityCommittedSnapshot(), which just returns a Status and sets _majorityCommittedSnapshot. That snapshot (now Timestamp) is a lie, however, because the variable is overwritten when a transaction is actually opened. There can't be any callers that depend on the getPointInTimeReadTimestamp() being accurate, because the Timestamp can advance between that call and opening a transaction.

This confuses the RecoveryUnit API unnecessarily and is an exception to how every other ReadSource operates.

I propose the following improvements:

  • Replace obtainMajorityCommittedSnapshot() with a const function that only returns a Status. Name it majorityCommittedSnapshotAvailable
  • Remove _majorityCommittedSnapshot and use _readAtTimestamp like every other ReadSource.


 Comments   
Comment by Githook User [ 26/Oct/20 ]

Author:

{'name': 'Brian DeLeonardis', 'email': 'brian.deleonardis@mongodb.com', 'username': 'bdeleonardis1'}

Message: SERVER-47752 Refactor kMajorityCommitted to not receive special treatment
Branch: master
https://github.com/mongodb/mongo/commit/c0b9b346586b4b7c97fde38ea97a98a42da0b572

Comment by Brian DeLeonardis (Inactive) [ 23/Oct/20 ]

https://mongodbcr.appspot.com/712200001/

Generated at Thu Feb 08 05:15:07 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.