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

Inspect all usages of CollectionMetadata::getChunkManager() and hide it from the public API

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 8.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Catalog and Routing
    • Fully Compatible
    • ALL
    • CAR Team 2024-02-19

      The CollectionMetadata::getChunkManager() method exposes internal implementation detail of the ownership state of the shard role. This detail is dangerous to use, because it happens to also contain the ownership state of other shards without any guarantee of its stability.

      For example, this piece of code makes a correctness-critical assumption for change streams, based on cached (and possibly stale) information that the recipient of a chunk doesn't contain any data. This is not correct to do, because between the time the donor recovers its ownership information and the time this check is performed, there is no guarantee that the recipient hasn't received something or lost all its chunks.

      The goal of this ticket is to:

      1. Inspect all calls to CollectionMetadata::getChunkManager() and if they legitimately only look at ranges owned by the shard (shard role usage), place them as semantic operations on the ScopedCollectionOwnershipFilter similar to this one.
      2. If they look at ranges that are not owned by the shard, file SERVER tickets explaining the bugs that this may lead to, the versions impacted and relate them to this ticket (e.g. SERVER-85914).
      3. Hide CollectionMetadata::getChunkManager() from the public section of CollectionMetadata.

            Assignee:
            adam.farkas@mongodb.com Wolfee Farkas
            Reporter:
            kaloian.manassiev@mongodb.com Kaloian Manassiev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: