0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

SERVER-24926 ensure replication in replset8.js is caught up after update to check collection size

This commit is contained in:
Benety Goh 2016-07-06 13:39:48 -04:00
parent 128fdb3672
commit 91ab93c35b

View File

@ -47,18 +47,15 @@ assert.writeOK(bulk.execute());
var slave = rt.add();
rt.reInitiate();
print("initiation complete!");
var sc = slave.getDB('d')['c'];
slave.setSlaveOk();
sleep(25000);
rt.awaitSecondaryNodes();
print("updating documents backwards");
// Move all documents to the beginning by growing them to sizes that should
// fit the holes we made in phase 1
bulk = mdc.initializeUnorderedBulkOp();
for (i = doccount * 2; i > doccount; --i) {
mdc.update({_id: i, x: i}, {_id: i, x: bigstring});
bulk.find({_id: i, x: i}).update({$set: {x: bigstring}});
bigstring = bigstring.slice(0, -1); // remove last char
}
assert.writeOK(bulk.execute({writeConcern: {w: rt.nodes.length}}));
print("finished");
// Wait for replication to catch up.
rt.awaitSecondaryNodes();
assert.eq(doccount + 1, slave.getDB('d')['c'].find().itcount());