Skip to content

Commit 34333a9

Browse files
committed
SERVER-34306: include host in validate error messages
1 parent 681d1e0 commit 34333a9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

jstests/hooks/validate_collections.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ function CollectionValidator() {
7070
' since collection was not found');
7171
continue;
7272
}
73-
print('Collection validation failed with response: ' + tojson(res));
73+
const host = db.getMongo().host;
74+
print('Collection validation failed on host ' + host + ' with response: ' +
75+
tojson(res));
7476
dumpCollection(coll, 100);
7577
success = false;
7678
}
@@ -92,14 +94,14 @@ function CollectionValidator() {
9294
const dbNames = conn.getDBNames();
9395
for (let dbName of dbNames) {
9496
if (!validatorFunc(conn.getDB(dbName), {full: true})) {
95-
return {ok: 0};
97+
return {ok: 0, host: host};
9698
}
9799
}
98100
return {ok: 1};
99101
} catch (e) {
100102
print('Exception caught in scoped thread running validationCollections on server: ' +
101103
host);
102-
return {ok: 0, error: e.toString(), stack: e.stack};
104+
return {ok: 0, error: e.toString(), stack: e.stack, host: host};
103105
}
104106
};
105107

0 commit comments

Comments
 (0)