Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-66361

Address data race involving ReplicationCoordinatorMock::setCurrentCommittedSnapshotOpTime()

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • Hide

      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
      
      Show
      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
    • Repl 2022-05-30, Repl 2022-06-13, Repl 2022-06-27
    • 5

      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.

            Assignee:
            lingzhi.deng@mongodb.com Lingzhi Deng
            Reporter:
            brett.nawrocki@mongodb.com Brett Nawrocki
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: