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

Avoid the usage of dropCollectionEvenIfSystem() outside of resharding code

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Sharding EMEA
    • Fully Compatible
    • Sharding EMEA 2023-02-06, Sharding EMEA 2023-02-20

      As part of SERVER-69603, the ensureCollectionDropped() function of src/mongo/db/s/resharding/resharding_data_copy_util.cpp was promoted to a generic sharding utility (sharding_ddl_util::ensureCollectionDroppedNoChangeEvent()) to drop both user and system collections.

      As SERVER-71880 demonstrated, such approach was flawed, since the utility function contained a method of the local catalog that cannot be safely used outside the context of a resharding operation.

      To avoid similar issues in the future,

      • ensureCollectionDroppedNoChangeEvent() should be removed from sharding_ddl_util
      • the original version of ensureCollectionDropped() should be reintroduced.

            enrico.golfieri@mongodb.com Enrico Golfieri
            paolo.polato@mongodb.com Paolo Polato
            0 Vote for this issue
            4 Start watching this issue