[SERVER-41792] Starting replica set member standalone with recoverFromOplogAsStandalone as true should replay entries from oplog based on the checkpoint we start from. Created: 17/Jun/19  Updated: 29/Oct/23  Resolved: 24/Sep/19

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: 4.0.10
Fix Version/s: 4.0.13

Type: Bug Priority: Major - P3
Reporter: Suganthi Mani Assignee: Vesselina Ratcheva (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-38356 Forbid dropping oplog in standalone m... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Repl 2019-08-12, Repl 2019-08-26, Repl 2019-09-09, Repl 2019-09-23, Repl 2019-10-07
Participants:

 Description   

This work came out of SERVER-38356. On 4.0, we replay entries from oplog on standalone nodes during startup only if the below conditions are satisfied.

  • Cond#1 : recoverFromOplogAsStandalone paramset to true.
  • Cond#2 : supportsRecoverToStableTimestamp() returns true.
  • Cond#3 : getRecoveryTimestamp() returns a non-empty timestamp.

When enableMajorityReadConcern(EMRC) is false, supportsRecoverToStableTimestamp() returns false. If it's true, then supportsRecoverToStableTimestamp returns true. So, incase if the node was originally started with EMRC true and restarted as standalone with EMRC false + recoverFromOplogAsStandalone set to true, then the wiredTiger storage engine starts from the stable checkpoint(/recovery timestamp). This means, we should replay the oplog entries from stable checkpoint to top of the oplog. But, because cond#2 returns false for EMRC false, we don't replay oplog entries.

On 4.2, its not a problem, as cond#2 is replaced by supportsRecoveryTimestamp() which always return true for wiredTiger regardless of EMRC value. Basically cond#3 is the one which determines what checkpoint we started from. If we started from a stable checkpoint, then getRecoveryTimestamp() returns a non-empty timestamp value. Else, for unstable checkpoint, the recovery timestamp is empty. So, we should implement the similar thing on 4.0 (i.e, cond#2 should be replaced by supportsRecoveryTimestamp()).



 Comments   
Comment by Githook User [ 24/Sep/19 ]

Author:

{'username': 'vessy-mongodb', 'email': 'vesselina.ratcheva@mongodb.com', 'name': 'Vesselina Ratcheva'}

Message: SERVER-41792 Make recoverFromOplogAsStandalone always replay entries from the checkpoint the node was started from
Branch: v4.0
https://github.com/mongodb/mongo/commit/d4c9bb6282f1b3371cb01c35a0be0b6cbc540906

Generated at Thu Feb 08 04:58:42 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.