|
These lines can be removed from jstests/libs/check_orphans_are_deleted_helpers.js after the changes from SERVER-6491. Removing this escape hatch will increase our confidence the sharding consistency checks are truly running and not being inadvertently skipped.
// It is possible for a test to drop the shard key index. We skip running the check for
|
// orphan documents being deleted from that collection if it doesn't have a shard key
|
// index.
|
const hintRes = shardConn.getDB(dbName).runCommand({
|
find: collName,
|
hint: collDoc.key,
|
limit: 1,
|
singleBatch: true,
|
});
|
|
if (hintRes.ok !== 1) {
|
assert(
|
/hint provided does not correspond to an existing index/.test(hintRes.errmsg),
|
() => {
|
return 'expected query failure due to bad hint: ' + tojson(hintRes);
|
});
|
print('Failed to find shard key index on ' + ns +
|
' so skipping check for orphan documents being deleted');
|
return;
|
}
|
|