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

Force a copy of the stable timestamp for clarity

    XMLWordPrintable

    Details

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

      Description

      _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.

        Attachments

          Activity

            People

            • Assignee:
              keith.bostic Keith Bostic
              Reporter:
              keith.bostic Keith Bostic
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: