Sharding state is set to initialized on Grid before sharding components are fully initialized

XMLWordPrintableJSON

    • Fully Compatible
    • ALL
    • v4.0, v3.6
    • Sharding 2018-10-22, Sharding 2018-11-05, Sharding 2018-11-19, Sharding 2018-12-17
    • 51
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      This can trigger a crash or incorrect behavior if the sharding components are accessed before being fully initialized.

      One example is that the ShardServerCatalogCacheLoader is created in initializeGlobalShardingStateForMongoD before Grid::setShardingInitialized but its ReplicaSetRole member variable is initialized later in initializeShardingEnvironmentOnShardServer after Grid::setShardingInitialized. This can lead to a crash because various methods in the ShardServerCatalogCacheLoader invariant that the ReplicaSetRole will not be ReplicaSetRole::None.

      An example is shown here (and the corresponding Evergreen task).

              Assignee:
              Esha Maharishi (Inactive)
              Reporter:
              Blake Oler
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: