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

Fix UpdateDriver::modsAffectIndices false-negative in v6.0

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major - P3 Major - P3
    • None
    • 6.0.4
    • None
    • None
    • Query Execution
    • ALL
    • Hide

      reproduce.js script is attached

      Show
      reproduce.js script is attached
    • QE 2023-05-15, QE 2023-05-29
    • 9

    Description

      In mongod versions <= 6.0 UpdateDriver::modsAffectIndices can produce false-negative result.

      It is fixed in 6.3.0-rc0 with SERVER-65364, but this change is too massive to safely backport it as is even to 6.0.

      In this ticket we need to implement a custom small fix to 6.0 and try to backport it as far as possible.

      How to reproduce:

      1. Create wildcard index 

        {"b.d.$**": 1} 

      1. Add document 

        {a: 1}
        

      1. Update document with 

        {$set: {"b.c": 1}}
        

      1. Call validate({full: true}) on the collection.

      Validation will show that there is missing index key "b" for the updated document.

      Fortunately this redundant key will never be used because the path 'b' is not covered by the wildcard path, b.d.$** and the index bounds generated for wildcard indexes will always match the path.

      Attachments

        Activity

          People

            ivan.fefer@mongodb.com Ivan Fefer
            ivan.fefer@mongodb.com Ivan Fefer
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: