[SERVER-66361] Address data race involving ReplicationCoordinatorMock::setCurrentCommittedSnapshotOpTime() Created: 10/May/22  Updated: 29/Oct/23  Resolved: 24/Jun/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: Brett Nawrocki Assignee: Lingzhi Deng
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Problem/Incident
is caused by SERVER-54394 Remove flag to avoid using snapshot r... Closed
is caused by SERVER-61772 Implement tenant access blocking for ... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

1. Generate ninja config to build with tsan:

python ./buildscripts/scons.py --modules= --dbg=on --opt=on --use-libunwind=off --variables-files=./etc/scons/mongodbtoolchain_stable_clang.vars --ninja generate-ninja --sanitize=thread --allocator=system NINJA_PREFIX=tsan VARIANT_DIR=tsan-debug

2. Build unit tests:

ninja -f tsan.ninja -j 16 +db_s_config_server_test

3. Configure tsan options:

export TSAN_OPTIONS="halt_on_error=1:report_thread_leaks=0:die_after_fork=0:suppressions=etc/tsan.suppressions:external_symbolizer_path=/opt/mongodbtoolchain/v3/bin/llvm-symbolizer"

4. Run test on a single cpu to increase failure odds:

numactl --physcpubind=0 ./build/tsan-debug/install/bin/db_s_config_server_test --filter ReshardingCoordinatorSuccessfullyTransitionsTokDone --repeat 1000

Sprint: Repl 2022-05-30, Repl 2022-06-13, Repl 2022-06-27
Participants:
Linked BF Score: 5

 Description   

As seen in BF-25138, ThreadSanitizer reports a data race surrounding the usage of setCurrentCommittedSnapshotOpTime() in the ReplicationCoordinatorMock. The actual implementation of the replication coordinator holds a lock while doing similar updates.



 Comments   
Comment by Githook User [ 24/Jun/22 ]

Author:

{'name': 'Lingzhi Deng', 'email': 'lingzhi.deng@mongodb.com', 'username': 'ldennis'}

Message: SERVER-66361: Fix data race involving ReplicationCoordinatorMock::setCurrentCommittedSnapshotOpTime()
Branch: master
https://github.com/mongodb/mongo/commit/d37641e0439f48745a656272a09eb121636ae7a2

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