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

WT_CURSOR.random and invisible updates

    • Type: Icon: Task Task
    • Resolution: Done
    • WT2.2.1
    • Affects Version/s: None
    • Component/s: None
    • Labels:

      The WT_CURSOR.random method can return an insert object from a page without on-page entries, and immediately calls __wt_kv_return; if the update record for the insert object is invisible to the session, we'll drop core because we expect to reference a valid page object any time we don't have a WT_INSERT/WT_UPDATE pair.

      Here's the script:

      from helper import key_populate, value_populate
      import wiredtiger, wttest
      
      # test_xxx.py
      class test_xxx(wttest.WiredTigerTestCase):
      
          def test_next_random_invisible(self):
              uri = 'table:xxx'
              self.session.begin_transaction()
              self.session.create(uri, 'key_format=S,value_format=S')
              cursor = self.session.open_cursor(uri, None)
              for i in range(1, 100):
                  cursor.set_key(key_populate(cursor, i))
                  cursor.set_value(value_populate(cursor, i))
                  cursor.insert()
              s = self.conn.open_session()
              cursor = s.open_cursor(uri, None, "next_random=true")
              cursor.next()
      
      if __name__ == '__main__':
          wttest.run()
      

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

              Created:
              Updated:
              Resolved: