[SERVER-68451] Allow initial sync retry to reset the catalog without untimestamped writes. Created: 01/Aug/22  Updated: 29/Oct/23  Resolved: 01/Aug/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Daniel Gottlieb (Inactive) Assignee: Yuhong Zhang
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Execution Team 2022-08-08
Participants:
Linked BF Score: 135

 Comments   
Comment by Githook User [ 01/Aug/22 ]

Author:

{'name': 'Yuhong Zhang', 'email': 'yuhong.zhang@mongodb.com', 'username': 'YuhongZhang98'}

Message: SERVER-68451 Allow initial sync retry to reset the catalog without untimestamped writes
Branch: master
https://github.com/mongodb/mongo/commit/8369e8eed7bdb1a7280f512f2efc7a6ce15dfc0a

Comment by Daniel Gottlieb (Inactive) [ 01/Aug/22 ]

The following patch should suffice:

diff --git a/src/mongo/db/repl/initial_syncer.cpp b/src/mongo/db/repl/initial_syncer.cpp
index 5001927d8dc..087204e1df1 100644
--- a/src/mongo/db/repl/initial_syncer.cpp
+++ b/src/mongo/db/repl/initial_syncer.cpp
@@ -807,6 +807,9 @@ Status InitialSyncer::_truncateOplogAndDropReplicatedDatabases() {
                 "namespace"_attr = NamespaceString::kRsOplogNamespace);
 
     auto opCtx = makeOpCtx();
+    // This code can make untimestamped writes (deletes) to the _mdb_catalog on top of existing
+    // timestamped updates.
+    opCtx->recoveryUnit()->allowUntimestampedWrite();
 
     // We are not replicating nor validating these writes.
     UnreplicatedWritesBlock unreplicatedWritesBlock(opCtx.get());

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