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

Commit timestamp assertions didn't catch invalid timestamps in specific scenario

    • 5
    • Storage - Ra 2021-11-29

      In the scenario where we commit an update to a key without a timestamp and then set the transaction timestamp to 2 and then add another update to the same key and then commit the transaction with timestamp 4 we will end up with an update chain which goes 2 -> 4 and it doesn't create an error which it should given write_timestamp_usage is enabled.

      Reproducer:

      import wiredtiger, wttest, time, shutil
      from wtscenario import make_scenarios
      
      # test_write_ts_usage.py
      class test_write_ts_usage(wttest.WiredTigerTestCase):
          conn_config = 'cache_size=200MB,eviction=(threads_max=1)'
          session_config = 'isolation=snapshot'
          key_format_values = [
              ('integer-row', dict(key_format='i')),
          ]
          scenarios = make_scenarios(key_format_values)
      
          def test_write_ts_usage(self):
              uri = "table:test_write_ts_usage"
              create_params = 'write_timestamp_usage=ordered,assert=(write_timestamp=on),verbose=[write_timestamp],value_format=S,key_format={}'.format(self.key_format)
              value3 = 'c' * 100
              value4 = 'd' * 100
              self.session.create(uri, create_params)
              cursor = self.session.open_cursor(uri)
              self.conn.set_timestamp('oldest_timestamp=' + self.timestamp_str(1) +
                  ',stable_timestamp=' + self.timestamp_str(1))
      
              self.session.begin_transaction()
              cursor[1] = value3
              self.session.timestamp_transaction('commit_timestamp=' + self.timestamp_str(3))
              cursor[1] = value4
              self.session.commit_transaction('commit_timestamp=' + self.timestamp_str(4))
      
      if __name__ == '__main__':
          wttest.run()
      
      

      Work to do:

      • Reproduce the issue
      • Identify whether a fix is appropriate or if WT-8169 will prevent the issue from occurring in the future.

            Assignee:
            backlog-server-storage-engines [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            luke.pearson@mongodb.com Luke Pearson
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: