-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Sharding
-
Fully Compatible
-
ALL
-
v5.0
-
Sharding 2021-09-20, Sharding 2021-10-04
-
163
-
1
ReshardingOpObserver is enabled on both --configsvrs and --shardsvrs. However, config servers use CollectionShardingStateStandalone rather than CollectionShardingRuntime and means calling CollectionShardingRuntime::get() on a config server is incorrect.
void assertCanExtractShardKeyFromDocs(OperationContext* opCtx, const NamespaceString& nss, std::vector<InsertStatement>::const_iterator begin, std::vector<InsertStatement>::const_iterator end) { const auto metadata = CollectionShardingRuntime::get(opCtx, nss)->getCurrentMetadataIfKnown(); // A user can manually create a 'db.system.resharding.' collection that isn't guaranteed to be // sharded outside of running reshardCollection. uassert(ErrorCodes::NamespaceNotSharded, str::stream() << "Temporary resharding collection " << nss.toString() << " is not sharded", metadata && metadata->isSharded()); ... }