Details
-
Bug
-
Resolution: Fixed
-
Major - P3
-
None
-
Fully Compatible
-
ALL
-
v5.0
-
Sharding 2021-09-20, Sharding 2021-10-04
-
163
-
1
Description
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.
69
|
void assertCanExtractShardKeyFromDocs(OperationContext* opCtx, |
70
|
const NamespaceString& nss, |
71
|
std::vector<InsertStatement>::const_iterator begin,
|
72
|
std::vector<InsertStatement>::const_iterator end) {
|
73
|
const auto metadata = CollectionShardingRuntime::get(opCtx, nss)->getCurrentMetadataIfKnown(); |
74
|
// A user can manually create a 'db.system.resharding.' collection that isn't guaranteed to be |
75
|
// sharded outside of running reshardCollection. |
76
|
uassert(ErrorCodes::NamespaceNotSharded,
|
77
|
str::stream() << "Temporary resharding collection " << nss.toString() |
78
|
<< " is not sharded", |
79
|
metadata && metadata->isSharded());
|
80
|
|
81
|
...
|
82
|
}
|