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

ShardingCatalogManager::updateTimeSeriesGranularity does not take _kChunkOpLock

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Fully Compatible
    • ALL
    • Sharding EMEA 2022-12-26, Sharding EMEA 2023-01-09, Sharding EMEA 2023-01-23

      ShardingCatalogManager::updateTimeSeriesGranularity calls bumpMajorVersionOneChunkPerShard, which was originally meant to be called with the _kChunkOpLock held. This is needed because bumpMajorVersionOneChunkPerShard will need to compute a new updated collectionVersion, so this requires serializing with any other possible update the collection version. However, updateTimeSeriesGranularity is not taking _kChunkOpLock.

      This ticket is to take _kChunksOpLock in updateTimeSeriesGranularity and also to add a comment on bumpMajorVersionOneChunkPerShard's declaration noting that it requires that lock to be held. Additionally, we could add an invariant that the lock is held.

            antonio.fuschetto@mongodb.com Antonio Fuschetto
            jordi.serra-torrens@mongodb.com Jordi Serra Torrens
            0 Vote for this issue
            3 Start watching this issue