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

Fix race where multiple threads are turning an index multikey concurrently

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.1.1, 5.0.14, 6.0.3, 6.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • v6.1, v6.0, v5.0
    • Execution Team 2022-11-14
    • 115

      In BF-26686 we see an inconsistent multikey state in the in-memory catalog.
      From the comments under BF-26686 we witness two (presumably) concurrent inserts occur:

      { “_id” : ObjectId(“633a9b678c7aa637fbd079a6"), “a” : [ { “b” : [ 2 ] } ] }
      { “_id” : ObjectId(“633a9b678c7aa637fbd079ac”), “a” : { “b” : [ -1, -2 ] } }

      Notably, the first insert will set the multikey path for a and b while the second document will only set b. Ultimately, we only have b as a multikey path (on disk).

      We potentially have a situation where writers could be obtaining copies of the collection metadata before it is marked as multikey and the second writer could overwrite the other writer’s collection metadata write. 

      This ticket would include writing a detailed c++ test to verify the findings and potential bug.

            Assignee:
            henrik.edin@mongodb.com Henrik Edin
            Reporter:
            fausto.leyva@mongodb.com Fausto Leyva (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: