summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordi Serra Torrens <jordi.serra-torrens@mongodb.com>2022-04-04 13:00:04 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-04-04 13:40:17 +0000
commite2accb7dc1f8d1b465f5628fbbfec18e5f3fa713 (patch)
tree59fa569ff67d5f7ba13a7c4bef6b2e4b9ac6b5ae
parent552f88138a0d5caeeb32f351019801b48254d1cd (diff)
downloadmongo-e2accb7dc1f8d1b465f5628fbbfec18e5f3fa713.tar.gz
SERVER-65216 Print idle cursors after checkOrphansAreDeleted jstest hook failure
-rw-r--r--jstests/libs/check_orphans_are_deleted_helpers.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/jstests/libs/check_orphans_are_deleted_helpers.js b/jstests/libs/check_orphans_are_deleted_helpers.js
index 5869b2e6e47..e98e7ffea3f 100644
--- a/jstests/libs/check_orphans_are_deleted_helpers.js
+++ b/jstests/libs/check_orphans_are_deleted_helpers.js
@@ -61,6 +61,22 @@ var CheckOrphansAreDeletedHelpers = (function() {
return rangeDeletions.length === 0;
},
() => {
+ try {
+ const adminDB = shardConn.getDB('admin');
+ const idleCursors =
+ adminDB
+ .aggregate([
+ {$currentOp: {idleCursors: true, allUsers: true}},
+ {$match: {type: 'idleCursor', ns: ns}}
+ ])
+ .toArray();
+ print("Idle cursors on " + ns + " @ " + shardId + ": " +
+ tojson(idleCursors));
+ } catch (e) {
+ print("Failed to get idle cursors for " + ns + " @ " + shardId + ": " +
+ tojson(e));
+ }
+
return 'timed out waiting for rangeDeletions on ' + ns + ' to be empty @ ' +
shardId + ', last known contents: ' + tojson(rangeDeletions);
});