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

Make drop collection take the distlock before attempting routing table refresh

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Sharding
    • None
    • Sharding 2017-10-23
    • 0

      queryoptimizer3.js does drop collection commands in parallel, which can conflict. See the linked BF for a full description.

      In summary, drop collection first refreshes it's routing metadata, then takes the distlock and proceeds to delete data and metadata under the protection of the distlock. The problem occurs when one drop collection command is running, has acquired the distlock, cleared shard data and cleared config.chunks entries, but not the config.collections entry. Then another drop collection command arrives and tries to refresh before getting blocked by the distlock. The refresh fails 10 times (ConflictingOperationInProgress), the command fails, and the test fails.

      Drop collection should take the distlock before calling getCollectionRoutingInfo, so that the command cannot conflict with itself, and prevent changes to the metadata it sees.

            Assignee:
            esha.maharishi@mongodb.com Esha Maharishi (Inactive)
            Reporter:
            dianna.hohensee@mongodb.com Dianna Hohensee (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: