[SERVER-69492] check_orphans_are_deleted_helpers.js can safely assume the shard key index cannot be dropped Created: 07/Sep/22  Updated: 29/Oct/23  Resolved: 15/Feb/23

Status: Closed
Project: Core Server
Component/s: Sharding, Testing Infrastructure
Affects Version/s: None
Fix Version/s: 7.0.0-rc0

Type: Task Priority: Major - P3
Reporter: Max Hirschhorn Assignee: Pol Pinol
Resolution: Fixed Votes: 0
Labels: neweng, sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-46068 Add hook at the end of sharding passt... Closed
is related to SERVER-46059 Add hook at the end of concurrency te... Closed
is related to SERVER-69491 Run CheckRoutingTableConsistency hook... Closed
is related to SERVER-6491 Prevent dropping shard key index when... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding EMEA 2022-11-28, Sharding EMEA 2022-12-12, Sharding EMEA 2022-12-26, Sharding EMEA 2023-01-09, Sharding EMEA 2023-01-23, Sharding EMEA 2023-02-06, Sharding EMEA 2023-02-20
Participants:

 Description   

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;
}



 Comments   
Comment by Githook User [ 15/Feb/23 ]

Author:

{'name': 'Pol Pinol Castuera', 'email': 'pol.pinol@mongodb.com', 'username': 'PolPinol'}

Message: SERVER-69492 check_orphans_are_deleted_helpers.js can safely assume the shard key index cannot be dropped
Branch: master
https://github.com/mongodb/mongo/commit/c4f0a253a021820689e4873ce39b77f8d6ac2e22

Generated at Thu Feb 08 06:13:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.