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

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • Replication
    • Repl 2023-11-27, Repl 2023-12-25, Repl 2024-01-08

    Description

      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.

      Attachments

        Activity

          People

            backlog-server-repl Backlog - Replication Team
            huayu.ouyang@mongodb.com Huayu Ouyang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: