diff options
author | Hugh Tong <hugh.tong@mongodb.com> | 2022-02-03 22:42:47 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-02-03 23:10:28 +0000 |
commit | 0c136160c8c958b56a53b05da63201811eaeac50 (patch) | |
tree | 8649ca276ce9d1a5669d078bfaa3d4df4b2060a3 | |
parent | 0b22fc40930c8fec72c80e18bc9039a65cacbea3 (diff) | |
download | mongo-0c136160c8c958b56a53b05da63201811eaeac50.tar.gz |
SERVER-62217 Use runCommand override to create _markNodeAsFailed override
-rw-r--r-- | jstests/libs/override_methods/inject_tenant_prefix.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/jstests/libs/override_methods/inject_tenant_prefix.js b/jstests/libs/override_methods/inject_tenant_prefix.js index fc9a1f11952..f324d0125f3 100644 --- a/jstests/libs/override_methods/inject_tenant_prefix.js +++ b/jstests/libs/override_methods/inject_tenant_prefix.js @@ -13,6 +13,7 @@ load("jstests/libs/transactions_util.js"); // This scoping allows the original methods to be called by the overrides below. let originalRunCommand = Mongo.prototype.runCommand; let originalRunCommandWithMetadata = Mongo.prototype.runCommandWithMetadata; +let originalMarkNodeAsFailed = Mongo.prototype._markNodeAsFailed; const denylistedDbNames = ["config", "admin", "local"]; @@ -606,6 +607,13 @@ Mongo.prototype.runCommand = function(dbName, cmdObj, options) { removeTenantId(resObj); } + Mongo.prototype._markNodeAsFailed = function(hostName, errorCode, errorReason) { + if (this.reroutingMongo) + originalMarkNodeAsFailed.apply(this.reroutingMongo, [hostName, errorCode, errorReason]); + else + originalMarkNodeAsFailed.apply(this, [hostName, errorCode, errorReason]); + }; + return resObj; }; |