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

Setting wildcard index as multikey can cause prepare conflicts

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Won't Fix
    • None
    • None
    • 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

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              judah.schvimer@mongodb.com Judah Schvimer
              samy.lanka@mongodb.com Samyukta Lanka
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: