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

Force a copy of the stable timestamp for clarity

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor - P4
    • Resolution: Fixed
    • None
    • 4.0.5, 4.1.6, WT3.2.0
    • None
    • None
    • 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

            keith.bostic@mongodb.com Keith Bostic
            keith.bostic@mongodb.com Keith Bostic
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: