Ensure safe access to ShardingDDLCoordinator instance state documents

XMLWordPrintableJSON

    • Fully Compatible
    • ALL
    • v6.0, v5.0
    • Sharding EMEA 2022-02-07, Sharding EMEA 2022-02-21, Sharding EMEA 2022-04-18, Sharding EMEA 2022-05-02, Sharding EMEA 2022-05-16
    • 15
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      Instances of ShardingDDLCoordinators maintain an in-memory copy of their state document (e.g). The coordinator's main thread reads and writes it (e.g.). Also, other threads also read it without proper syncronization (e.g. checkIfOptionsConflict, reportForCurrentOp). This can lead to data races. This same pattern is repeated on all ShardingDDLCoordinators.

      To solve it we could synchronize access to the in-memory state with a mutex, similarly to what was done on SERVER-54300. In this case, we need to make sure that writing the document to disk is not done with the mutex held (see SERVER-53996).

            Assignee:
            Enrico Golfieri
            Reporter:
            Jordi Serra Torrens
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: