diff options
author | Jiawei Yang <jiawei.yang@mongodb.com> | 2023-04-25 19:59:58 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-04-25 22:39:32 +0000 |
commit | 7b0241d42130bc1a8b8ee72e6fa0e3b102bf1a44 (patch) | |
tree | 6e51b30f524b84865211c9a332e8d755085d7f7a /jstests/replsets | |
parent | 0ed3c5ba08d56e308bf05959932b34d8d1e6040e (diff) | |
download | mongo-7b0241d42130bc1a8b8ee72e6fa0e3b102bf1a44.tar.gz |
SERVER-76422 wait all nodes to finish reconfig before stop replica set
Diffstat (limited to 'jstests/replsets')
-rw-r--r-- | jstests/replsets/rslib.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/jstests/replsets/rslib.js b/jstests/replsets/rslib.js index 1c4bafa3060..c741da7e373 100644 --- a/jstests/replsets/rslib.js +++ b/jstests/replsets/rslib.js @@ -26,6 +26,7 @@ var disconnectSecondaries; var reconnectSecondaries; var createRstArgs; var createRst; +var waitAllNodesHaveConfig; (function() { "use strict"; @@ -883,4 +884,16 @@ createRst = function(rstArgs, retryOnRetryableErrors) { } } }; + +/** + * Wait until all the nodes in a replica set have the same config as the input config. + */ +waitAllNodesHaveConfig = function(replSet, config) { + replSet.nodes.forEach(function(node) { + assert.soon(function() { + const nodeConfig = replSet.getReplSetConfigFromNode(node.nodeId); + return isSameConfigContent(config, nodeConfig); + }); + }); +}; }()); |