Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-4440

Force a copy of the stable timestamp for clarity

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 4.0.5, 4.1.6, WT3.2.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Engines 2018-11-19, Storage Engines 2018-12-03

      _txn_rollback_to_stable_lookaside_fixup() and _txn_rollback_to_stable_btree() both include a code fragment like this:

      /*      
       * Copy the stable timestamp, otherwise we'd need to lock it each time
       * it's accessed. Even though the stable timestamp isn't supposed to be
       * updated while rolling back, accessing it without a lock would
       * violate protocol.
       */      
      rollback_timestamp = txn_global->stable_timestamp;
      

      However, WT_TXN_GLOBAL.stable_timestamp is not declared volatile, so there's nothing to prevent the compiler from reordering or rewriting the instruction.

            Assignee:
            keith.bostic@mongodb.com Keith Bostic (Inactive)
            Reporter:
            keith.bostic@mongodb.com Keith Bostic (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: