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

Fix search near exact edge case with bounded cursor

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • WT10.0.1, 6.2.0-rc0, 6.1.0-rc2
    • Affects Version/s: None
    • Component/s: None
    • None
    • 5
    • Storage Engines - 2022-08-22, Storage Engines - 2022-09-05

      Currently if an external user has bounds set on a cursor, and then the user performs a search near, there is an edge case where it is possible that the exact compare variable leads to a wrong value. The exact edge case comes as:

      1. Imagine a table with inserted keys aaa -> aaz
      2. Cursor has lower bounds as aay and upper bounds aaz
      3. Now the cursor will do a search near on aa
      4. The expected behaviour is that search near should return aay with exact = 1, denoting that the aay comes after aa. Instead the current behaviour returns back as aay with exact = 0.

      The reproducer for the problem is here:

              set_prefix_bound(self, cursor3, "aaz")
              cursor3.set_key("aa")
              self.session.breakpoint()
              self.assertEqual(cursor3.search_near(), 1)
              self.assertEqual(cursor3.get_key(), self.check_key("aaz"))
      

            Assignee:
            clarisse.cheah@mongodb.com Clarisse Cheah
            Reporter:
            jie.chen@mongodb.com Jie Chen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: