summaryrefslogtreecommitdiff
path: root/jstests/replsets/rollback.js
diff options
context:
space:
mode:
authorRandolph Tan <randolph@10gen.com>2014-03-03 11:27:18 -0500
committerRandolph Tan <randolph@10gen.com>2014-03-14 12:05:05 -0400
commiteb41492c6f1228077b92239524e4a607b70cd8e3 (patch)
treec90485d43753aa756063d0a6e8f67b8843931bba /jstests/replsets/rollback.js
parente44682821c37fdf3d4fd8cb58dcf5c34181ddbde (diff)
downloadmongo-eb41492c6f1228077b92239524e4a607b70cd8e3.tar.gz
SERVER-13190 migrate replset jstest suite to use write commands api
Diffstat (limited to 'jstests/replsets/rollback.js')
-rw-r--r--jstests/replsets/rollback.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/jstests/replsets/rollback.js b/jstests/replsets/rollback.js
index 7ec3810fbdc..fd174ff4703 100644
--- a/jstests/replsets/rollback.js
+++ b/jstests/replsets/rollback.js
@@ -51,7 +51,7 @@ function wait(f) {
doTest = function (signal) {
- var replTest = new ReplSetTest({ name: 'unicomplex', nodes: 3 });
+ var replTest = new ReplSetTest({ name: 'unicomplex', nodes: 3, oplogSize: 1 });
var nodes = replTest.nodeList();
//print(tojson(nodes));
@@ -93,8 +93,13 @@ doTest = function (signal) {
var first = a.getSisterDB("local").oplog.rs.find().sort({ $natural: 1 }).limit(1)[0];
a.roll.insert({ x: 1 });
while (1) {
- for (var i = 0; i < 10000; i++)
- a.roll.update({}, { $inc: { x: 1} });
+ var bulk = a.roll.initializeUnorderedBulkOp();
+ for (var i = 0; i < 1000; i++) {
+ bulk.find({}).update({ $inc: { x: 1 }});
+ }
+ // unlikely secondary isn't keeping up, but let's avoid possible intermittent issues with that.
+ bulk.execute({ w: 2 });
+
var op = a.getSisterDB("local").oplog.rs.find().sort({ $natural: 1 }).limit(1)[0];
if (tojson(op.h) != tojson(first.h)) {
printjson(op);
@@ -102,7 +107,6 @@ doTest = function (signal) {
break;
}
pass++;
- a.getLastError(2); // unlikely secondary isn't keeping up, but let's avoid possible intermittent issues with that.
}
print("PASSES FOR OPLOG ROLL: " + pass);
}