summaryrefslogtreecommitdiff
path: root/jstests/replsets/replset8.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/replset8.js
parente44682821c37fdf3d4fd8cb58dcf5c34181ddbde (diff)
downloadmongo-eb41492c6f1228077b92239524e4a607b70cd8e3.tar.gz
SERVER-13190 migrate replset jstest suite to use write commands api
Diffstat (limited to 'jstests/replsets/replset8.js')
-rw-r--r--jstests/replsets/replset8.js19
1 files changed, 11 insertions, 8 deletions
diff --git a/jstests/replsets/replset8.js b/jstests/replsets/replset8.js
index cc900195cde..51cae86670a 100644
--- a/jstests/replsets/replset8.js
+++ b/jstests/replsets/replset8.js
@@ -17,28 +17,31 @@ var mdc = md[ 'c' ];
// documents to be increasing size.
// this should result in the updates moving the docs backwards.
-var doccount = 10000;
+var doccount = 5000;
// Avoid empty extent issues
mdc.insert( { _id:-1, x:"dummy" } );
print ("inserting bigstrings");
+var bulk = mdc.initializeUnorderedBulkOp();
for( i = 0; i < doccount; ++i ) {
- mdc.insert( { _id:i, x:bigstring } );
+ bulk.insert( { _id:i, x:bigstring } );
bigstring += "a";
}
-md.getLastError();
+assert.writeOK(bulk.execute());
print ("inserting x");
+bulk = mdc.initializeUnorderedBulkOp();
for( i = doccount; i < doccount*2; ++i ) {
- mdc.insert( { _id:i, x:i } );
+ bulk.insert( { _id:i, x:i } );
}
-md.getLastError();
+assert.writeOK(bulk.execute());
print ("deleting bigstrings");
+bulk = mdc.initializeUnorderedBulkOp();
for( i = 0; i < doccount; ++i ) {
- mdc.remove( { _id:i } );
+ bulk.find({ _id: i }).remove();
}
-md.getLastError();
+assert.writeOK(bulk.execute());
// add a secondary
var slave = rt.add();
@@ -50,9 +53,9 @@ sleep(25000);
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 } );
- md.getLastError();
bigstring = bigstring.slice(0, -1); // remove last char
}
print ("finished");