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

Set a recovered cluster role for replica-set to ClusterRole::None

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Catalog and Routing
    • 1

      Context

      The ShardingState can have 2 possible configurations which are determined by it's cluster role:

      • In a sharded cluster, the sharding state is enabled, which correspond to have set a cluster role in the sharding state != ClusterRole::None.
      • In a replica set, the sharding state is disabled, which correspond to a cluster role unset or None

      As a consequence, both the solution of leaving unset the role or setting it to cluster role of type None work to disable the sharding state. The role for that case is never set.

      Problem

      To check whether the sharding state is enabled we keep polling a future to retrieve the cluster role. For a replica set, that future is never ready, making that check slower. Enforcing a ClusterRole::None would leave the logic described above still valid, while improving performance over the check.

      In general, reasoning about a role which can be set or unset is harder.  

      Goal

      The goal of the ticket is to initialize the sharding state of a replica set with clusterRole::None. This assertion should also be updated to check for the role to be "clusterRole::None" and not to be unset.

            Assignee:
            Unassigned Unassigned
            Reporter:
            enrico.golfieri@mongodb.com Enrico Golfieri
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: