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

Make committed changes visible immediately

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: WT2.7.0
    • Labels:
      None
    • # Replies:
      15
    • Last comment by Customer:
      true

      Description

      A bug in WiredTiger caused updates to not be visible to concurrent readers immediately upon commit. Applications that rely on updates being visible immediately (including MongoDB) temporarily see unexpected results. After waiting or restarting, all committed data would be present and visible, but reads during this window could see "holes" with recent changes missing.

      Background: WiredTiger uses transaction snapshots to determine which versions of updates should be visible to readers. When a transaction T starts, it builds a list of transaction IDs of running transactions (the transactions concurrent with T). Updates created with those transaction IDs are not visible to reads in T.

      WiredTiger has avoided locking in the transaction subsystem by having threads race to allocate transaction IDs. Multiple threads can publish the same ID but only one thread wins the race and goes on to use that ID for updates. Other threads could temporarily leave a transaction ID published in the global state table. If T completes quickly enough that another thread still has T's ID published after T commits, then T's ID will appear in snapshots after T commits, delaying when T's updates become visible.

        Issue Links

          Activity

          Hide
          xgen-internal-githook Githook User added a comment -

          Author:

          {u'username': u'agorrod', u'name': u'Alex Gorrod', u'email': u'alexander.gorrod@mongodb.com'}

          Message: Merge pull request #2331 from wiredtiger/WT-2237

          WT-2237 Have threads publish unique transaction IDs so that updates always become visible immediately on commit.

          (cherry picked from commit 0a52a80a39fc47145fb755d792792ae820b266ed)
          Branch: mongodb-3.0
          https://github.com/wiredtiger/wiredtiger/commit/16a418b471953ad04973f5b013b1647e940ab769

          Show
          xgen-internal-githook Githook User added a comment - Author: {u'username': u'agorrod', u'name': u'Alex Gorrod', u'email': u'alexander.gorrod@mongodb.com'} Message: Merge pull request #2331 from wiredtiger/ WT-2237 WT-2237 Have threads publish unique transaction IDs so that updates always become visible immediately on commit. (cherry picked from commit 0a52a80a39fc47145fb755d792792ae820b266ed) Branch: mongodb-3.0 https://github.com/wiredtiger/wiredtiger/commit/16a418b471953ad04973f5b013b1647e940ab769
          Hide
          xgen-internal-githook Githook User added a comment -

          Author:

          {u'username': u'agorrod', u'name': u'Alex Gorrod', u'email': u'alexander.gorrod@mongodb.com'}

          Message: Merge pull request #2331 from wiredtiger/WT-2237

          WT-2237 Have threads publish unique transaction IDs so that updates always become visible immediately on commit.

          (cherry picked from commit 0a52a80a39fc47145fb755d792792ae820b266ed)
          Branch: mongodb-3.0
          https://github.com/wiredtiger/wiredtiger/commit/16a418b471953ad04973f5b013b1647e940ab769

          Show
          xgen-internal-githook Githook User added a comment - Author: {u'username': u'agorrod', u'name': u'Alex Gorrod', u'email': u'alexander.gorrod@mongodb.com'} Message: Merge pull request #2331 from wiredtiger/ WT-2237 WT-2237 Have threads publish unique transaction IDs so that updates always become visible immediately on commit. (cherry picked from commit 0a52a80a39fc47145fb755d792792ae820b266ed) Branch: mongodb-3.0 https://github.com/wiredtiger/wiredtiger/commit/16a418b471953ad04973f5b013b1647e940ab769
          Hide
          xgen-internal-githook Githook User added a comment -

          Author:

          {u'username': u'keithbostic', u'name': u'Keith Bostic', u'email': u'keith.bostic@mongodb.com'}

          Message: Merge pull request #2333 from wiredtiger/WT-2337-perf

          WT-2237 Avoid yields if we race allocating transaction IDs.

          (cherry picked from commit e90b5906b969e9e34c8aa7e304a5983ef8077bca)
          Branch: mongodb-3.0
          https://github.com/wiredtiger/wiredtiger/commit/06a5c7b7a99053110395209c23ff26d39ba22db4

          Show
          xgen-internal-githook Githook User added a comment - Author: {u'username': u'keithbostic', u'name': u'Keith Bostic', u'email': u'keith.bostic@mongodb.com'} Message: Merge pull request #2333 from wiredtiger/ WT-2337 -perf WT-2237 Avoid yields if we race allocating transaction IDs. (cherry picked from commit e90b5906b969e9e34c8aa7e304a5983ef8077bca) Branch: mongodb-3.0 https://github.com/wiredtiger/wiredtiger/commit/06a5c7b7a99053110395209c23ff26d39ba22db4
          Hide
          xgen-internal-githook Githook User added a comment -

          Author:

          {u'username': u'michaelcahill', u'name': u'Michael Cahill', u'email': u'michael.cahill@mongodb.com'}

          Message: Import wiredtiger-wiredtiger-mongodb-3.0.7-20-g27d0cbd.tar.gz from wiredtiger branch mongodb-3.0

          ref: deb2d81..27d0cbd

          6feaa28 WT-2251 Fix leaf of deleted page addresses.
          1da2d3a SERVER-21568 Fix a use-after-free.
          4228295 SERVER-21553 Free blocks during reverse splits.
          0398515 WT-2241 Use a lock to protect transaction ID allocation.
          06a5c7b WT-2237 Avoid yields if we race allocating transaction IDs.
          16a418b WT-2237 Have threads publish unique transaction IDs so that updates always become visible immediately on commit.
          Branch: v3.0
          https://github.com/mongodb/mongo/commit/eb8bc24a0d36b673022faa83976a4b33bc8f676b

          Show
          xgen-internal-githook Githook User added a comment - Author: {u'username': u'michaelcahill', u'name': u'Michael Cahill', u'email': u'michael.cahill@mongodb.com'} Message: Import wiredtiger-wiredtiger-mongodb-3.0.7-20-g27d0cbd.tar.gz from wiredtiger branch mongodb-3.0 ref: deb2d81..27d0cbd 6feaa28 WT-2251 Fix leaf of deleted page addresses. 1da2d3a SERVER-21568 Fix a use-after-free. 4228295 SERVER-21553 Free blocks during reverse splits. 0398515 WT-2241 Use a lock to protect transaction ID allocation. 06a5c7b WT-2237 Avoid yields if we race allocating transaction IDs. 16a418b WT-2237 Have threads publish unique transaction IDs so that updates always become visible immediately on commit. Branch: v3.0 https://github.com/mongodb/mongo/commit/eb8bc24a0d36b673022faa83976a4b33bc8f676b
          Hide
          xgen-internal-githook Githook User added a comment -

          Author:

          {u'username': u'michaelcahill', u'name': u'Michael Cahill', u'email': u'michael.cahill@mongodb.com'}

          Message: Import wiredtiger-wiredtiger-mongodb-3.0.7-20-g27d0cbd.tar.gz from wiredtiger branch mongodb-3.0

          ref: deb2d81..27d0cbd

          6feaa28 WT-2251 Fix leaf of deleted page addresses.
          1da2d3a SERVER-21568 Fix a use-after-free.
          4228295 SERVER-21553 Free blocks during reverse splits.
          0398515 WT-2241 Use a lock to protect transaction ID allocation.
          06a5c7b WT-2237 Avoid yields if we race allocating transaction IDs.
          16a418b WT-2237 Have threads publish unique transaction IDs so that updates always become visible immediately on commit.
          Branch: v3.0
          https://github.com/mongodb/mongo/commit/eb8bc24a0d36b673022faa83976a4b33bc8f676b

          Show
          xgen-internal-githook Githook User added a comment - Author: {u'username': u'michaelcahill', u'name': u'Michael Cahill', u'email': u'michael.cahill@mongodb.com'} Message: Import wiredtiger-wiredtiger-mongodb-3.0.7-20-g27d0cbd.tar.gz from wiredtiger branch mongodb-3.0 ref: deb2d81..27d0cbd 6feaa28 WT-2251 Fix leaf of deleted page addresses. 1da2d3a SERVER-21568 Fix a use-after-free. 4228295 SERVER-21553 Free blocks during reverse splits. 0398515 WT-2241 Use a lock to protect transaction ID allocation. 06a5c7b WT-2237 Avoid yields if we race allocating transaction IDs. 16a418b WT-2237 Have threads publish unique transaction IDs so that updates always become visible immediately on commit. Branch: v3.0 https://github.com/mongodb/mongo/commit/eb8bc24a0d36b673022faa83976a4b33bc8f676b

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              27 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since reply:
                1 year, 20 weeks, 6 days ago
                Date of 1st Reply: