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).