[SERVER-75686] Fix assert indexes racing with oplog applier in index build tests Created: 05/Apr/23  Updated: 29/Oct/23  Resolved: 06/Apr/23

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

Type: Bug Priority: Major - P3
Reporter: Yujin Kang Park Assignee: Yujin Kang Park
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
is related to SERVER-75588 DiskSpaceMonitor can increase killedD... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

diff --git a/src/mongo/db/repl/oplog.cpp b/src/mongo/db/repl/oplog.cpp
index fbf4eb586b0..bc86a85debf 100644
— a/src/mongo/db/repl/oplog.cpp
+++ b/src/mongo/db/repl/oplog.cpp
@@ -1016,6 +1016,7 @@ const StringMap<ApplyOpMetadata> kOpsMap = {
}
IndexBuildsCoordinator::get(opCtx)->applyStartIndexBuild(
opCtx, applicationMode, swOplogEntry.getValue());
+ sleep(1);
return Status::OK();
},
{ErrorCodes::IndexAlreadyExists,

Sprint: Execution Team 2023-04-17
Participants:
Linked BF Score: 35

 Description   

In some of our tests, there is a race between the index builder thread completing setup and reaching hangAfterInitializingIndexBuild, and the oplog applier thread waking up after setup is complete and marking the entry as applied, thus advancing the operationTime. In that case, the operation time will be less than the startIndexBuild entry timestamp, and the catalog will not contain the index.



 Comments   
Comment by Githook User [ 06/Apr/23 ]

Author:

{'name': 'Yu Jin Kang Park', 'email': 'yujin.kang@mongodb.com', 'username': 'ykangpark'}

Message: SERVER-75686 Fix assert indexes racing with oplog applier in index build tests
Branch: master
https://github.com/mongodb/mongo/commit/4054b36b656ba9ae700fd88f36a70e4e2921684a

Comment by Yujin Kang Park [ 05/Apr/23 ]

Linking SERVER-75588 because that fixed a somewhat similar issue with how we are asserting for indexes.

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