|
We should also check other shell helpers to make sure they conform to the correct schema, as well as jstests which query config.chunks manually, e.g. getSplitKeysForChunks(), and jstests/noPassthroughWithMongod/no_balance_collection.js
|
|
The query issued by getShardDistribution() is
COMMAND [conn5] command config.chunks appName: "MongoDB Shell" command: find { find: "chunks", filter: { _id: /^fuzzer\.fuzzer_coll-.*/, shard: "query_fuzzer-524659-1569598253645-0-rs1" }, lsid: { id: UUID("5ff2244a-cba2-4daa-8542-3e127733da82") }, $clusterTime: { clusterTime: Timestamp(1569600184, 224), signature: { hash: BinData(0, 0000000000000000000000000000000000000000), keyId: 0 } }, $db: "config" } nShards:1 cursorExhausted:1 numYields:0 nreturned:0 reslen:227 protocol:op_msg 0ms
|
Notice that the filter is
{ _id: /^fuzzer\.fuzzer_coll-.*/, shard: "query_fuzzer-524659-1569598253645-0-rs1" }
|
Now, compare that to the document in config.chunks for the namespace we're interested in:
{
|
"_id" : "5d8e32b2ac1435db017391b4",
|
"ns" : "fuzzer.fuzzer_coll",
|
"min" : {
|
"_id" : NumberLong(0)
|
},
|
"max" : {
|
"_id" : NumberLong("4611686018427387902")
|
},
|
"shard" : "query_fuzzer-524659-1569598253645-0-rs1",
|
"lastmod" : Timestamp(1, 2),
|
"lastmodEpoch" : ObjectId("5d8e32b2ac1435db017391b1"),
|
"history" : [
|
{
|
"validAfter" : Timestamp(1569600178, 44),
|
"shard" : "query_fuzzer-524659-1569598253645-0-rs1"
|
}
|
]
|
},
|
The _id is a normal object id! It turns out we changed the format of config.chunks for the refine shard key project. So, we need to update getShardDistribution to match the new schema.
|