Setting wildcard index as multikey can cause prepare conflicts

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Won't Fix
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • ALL
    • Hide

      1. Create a wildcard index
      2. Make the index multikey as part of a transaction
      3. Prepare the transaction
      4. Insert a doc into the same collection that would make the index multikey

      Show
      1. Create a wildcard index 2. Make the index multikey as part of a transaction 3. Prepare the transaction 4. Insert a doc into the same collection that would make the index multikey
    • 15
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      We can cause a prepare conflict if we set a wildcard index as multikey as part of a prepared transaction and then try to set it as multikey through a write separate from the transaction.

      The conflict comes from when we insert keys into the index itself for wildcard indexes (multiMetadataKeys is populated by the wildcard_key_generator). I think that is done in the same wuow as the transaction, which means that it will generate a prepare conflict if we try to write on top of it.

      I suspect this would be resolved if we did these writes in a side transaction block, like when we set the index as multikey.

        1. repro.js
          2 kB
          Samyukta Lanka

            Assignee:
            Judah Schvimer
            Reporter:
            Samyukta Lanka
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: