CollectionCacheRecoverer uses gap-intolerant RoutingTableHistory constructor

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Catalog and Routing
    • Fully Compatible
    • ALL
    • CAR Team 2026-04-27
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      When the authoritative collection metadata path is enabled, CollectionCacheRecoverer::recoverCollectionFromDisk rebuilds the routing table from the shard catalog by calling RoutingTableHistory::makeNew. That constructor sets _allowGaps = false, so the ChunkMap validates that the first chunk's min is MinKey and the last chunk's max is MaxKey.

      However, the write side (commit_collection_metadata_locally::updateShardCatalogCache and fetchOwnedChunks) intentionally persists only the chunks owned by the local shard, and constructs its in-memory RoutingTableHistory via RoutingTableHistory::makeNewAllowingGaps.

      As a result, whenever the local shard does not own chunks at one or both extremes of the key space, authoritative disk recovery uasserts with ChunkMetadataInconsistency (code 431): "Not all elements of { ... } are of type maxKey/minKey".

            Assignee:
            Pol Pinol
            Reporter:
            Pol Pinol
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: