Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-80654

Handle older index entry formats where keystring does not have recordID appended correctly for reverse lookup

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Replication
    • Fully Compatible
    • Repl 2023-11-27, Repl 2023-12-25, Repl 2024-01-08, Repl 2024-03-04, Repl 2024-03-18, Repl 2024-04-01, Repl 2024-04-15

      Based on https://github.com/10gen/mongo/blob/c5c3086dcae61481f80664f1de1dcd965aee2147/src/mongo/db/catalog/README.md#use-in-wiredtiger-indexes:

      During reverse lookup we should check if the secondary is unique or not, because for unique indexes the keystring might be stored without the recordID appended.

      Right now in reverse lookup we get the recordID from the keystring with decodeRecordId here, so that wouldn't work if the keystring doesn't have the recordID appended.

      It's possible we could just get the RecordId from the KeyStringEntry struct though in all cases: https://github.com/10gen/mongo/blob/bbf84d93a5bb9a9aaa3d7a52acd14673772d4997/src/mongo/db/storage/index_entry_comparison.h#L126

      Additionally, when we call getKeys we should check whether we should be passing in the recordId - if the keystring didn't have the recordID appended then I don't think we should pass in the recordId here either.

            Assignee:
            huayu.ouyang@mongodb.com Huayu Ouyang
            Reporter:
            huayu.ouyang@mongodb.com Huayu Ouyang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: