0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-21 12:39:08 +01:00

SERVER-87429 Create targeted jstest for magic restore and resharding (#28684)

GitOrigin-RevId: 0f6b57174f742d9d4043e7395335adef278ca9ee
This commit is contained in:
Ali Mir 2024-11-07 11:08:12 -05:00 committed by MongoDB Bot
parent dc6b7e8553
commit ec63b35f98

View File

@ -208,9 +208,23 @@ export class ShardedMagicRestoreTest {
this.magicRestoreTests.forEach((magicRestoreTest, idx) => {
const rstOptions = {"replSet": magicRestoreTest.rst.name};
// When performing a shard rename, we must replace the replica set '_id' field on the
// config. Cloud will determine the new config to insert into a node during restore, so
// we don't have to do this replacement in the server.
const replicaSetConfig = magicRestoreTest.getExpectedConfig();
if (this.shardingRename) {
for (let i = 0; i < this.numShards; i++) {
if (replicaSetConfig._id == this.shardingRename[i].sourceShardName) {
replicaSetConfig._id = this.shardingRename[i].destinationShardName;
break;
}
}
this.expectedConfig = replicaSetConfig;
}
let restoreConfiguration = {
"nodeType": idx > 0 ? "shard" : "configServer",
"replicaSetConfig": magicRestoreTest.getExpectedConfig(),
"replicaSetConfig": replicaSetConfig,
"maxCheckpointTs": this.maxCheckpointTs
};