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

CheckMetadataConsistency can trigger false positives due to looking at sharding metadata while critical section is active

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0
    • Affects Version/s: 8.0.0
    • Component/s: None
    • None
    • Catalog and Routing
    • Fully Compatible
    • ALL
    • v8.0
    • CAR Team 2024-09-30
    • 200
    • 1

      CheckMetadataConsistency uses the sharding metadata installed on the shards to determine if a shard currently owns chunks of a collection. And based on that, it determines if the collection should be present on the local catalog and flags an inconsistency if it isn't.

      CheckMetadataConsistency reads the sharding metadata by using CollectionShardingRuntime::getCurrentMetadataIfKnown, which ignores the critical section state – it simply returns the currently installed metadata, even if the critical section is active. If it is active, then the currently installed metadata might not be the valid one, since it is currently being changed. This can cause CheckMetadataConsistency to report false positives.

            Assignee:
            enrico.golfieri@mongodb.com Enrico Golfieri
            Reporter:
            jordi.serra-torrens@mongodb.com Jordi Serra Torrens
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: