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

DatabaseShardingState accesses ShardingState before initialization during recovery

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Catalog and Routing
    • Fully Compatible
    • ALL
    • CAR Team 2025-04-14
    • 200
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      Due to SERVER-102648, access to ShardingState is now restricted until it has been properly initialized. As a result, DatabaseShardingState fails during recovery because it tries to access the ShardId from ShardingState in the onConsistentDataAvailable method. This happens when reading from disk and installing the database metadata into DatabaseShardingState.

      Within that method (specifically in setDbInfo), there's a validation that checks whether the ShardingState::ShardId matches the one in the DbVersion. This is not strictly necessary and is only a sanity check.

      Therefore, I propose skipping this validation if ShardingState is not yet enabled—i.e., during recovery.

            Assignee:
            pol.pinol@mongodb.com Pol Pinol
            Reporter:
            pol.pinol@mongodb.com Pol Pinol
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: