Fix TSAN data race on last_ckpt_timestamp between checkpoint and sweep

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • WT12.0.0, 9.0.0-rc0
    • Affects Version/s: None
    • Component/s: Checkpoints
    • None
    • Storage Engines, Storage Engines - Transactions
    • 0.007
    • None
    • None

      TSAN reports a data race on WT_TXN_GLOBAL.last_ckpt_timestamp:

      • The sweep thread reads it with _wt_atomic_load_uint64_relaxed in _sweep_close_dhandle_locked (src/conn/conn_sweep.c:172).
      • The checkpoint thread writes it with a plain (non-atomic) store in __checkpoint_db_internal (src/checkpoint/checkpoint_txn.c:1887).
      • __disagg_finalize_checkpoint_meta (src/conn/conn_layered_checkpoint_pick_up.c:850) also writes it with a plain store.

      TSAN task: wiredtiger_ubuntu2004_tsan_format_stress_test_disagg_switch_tsan_571abbc77b039e7d70e6ea226127c1b4acd0cefd_26_07_06_13_34_40 (execution=0).

      Fix: change both plain writes to __wt_atomic_store_uint64_relaxed so they pair correctly with the relaxed load in sweep.

            Assignee:
            Shoufu Du
            Reporter:
            Shoufu Du
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: