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

Add union cursor support for cursor next/prev

    • Type: Icon: Task Task
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Not Applicable
    • None
    • 8

      The union cursor needs to traverse both the active and shared tables to compare based on the return key and return it to the application.

      The logic should be as follows:

      • Whenever a cursor next or prev is executed, it internally executes all the internal cursors based on the following:
      • We note down the presently returned cursor and perform the traverse operation on that cursor either next/prev.
      • Compare the current cursor returned value with the existing cursor values. If any of the cursors also have the same key, we never return the same key twice. It is possible that the same key exists in multiple member tables. Always return the highest timestamp visible data from the first member in the order of the tables.
      • Also check the other internal cursors whether the cursor found is lesser/greater than the last returned key.
      • In case the found key is smaller than the last returned key, the cursor must also be advanced to the next key if the operation is next.
      • In case the found key is greater than the last returned key, the cursor must also execute the prev operation if the cursor operation is prev.
      • Get the existing value of all the cursors and compare them and return the next lowest key for the next or highest key for prev operations compared to the current value that is pointed by the cursor.
      • Store the cursor key that is returned with the time window also.
      • In case the same key is found in two member tables, compare the timestamps and return the key/value of a higher timestamp cursor. The lower timestamp cursors are traversed either next/prev to fetch the next/prev key for the next/prev operation (this will be done at the next cursor operation)
      • Repeat this process from step 1 based on the next cursor move.

            Assignee:
            backlog-server-storage-engines [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            haribabu.kommi@mongodb.com Haribabu Kommi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: