diff options
author | Dwight <dwight@10gen.com> | 2010-08-23 16:09:04 -0400 |
---|---|---|
committer | Dwight <dwight@10gen.com> | 2010-08-23 16:09:04 -0400 |
commit | 7029641c97ff8de49b7b7fab9d11de54b4e4da59 (patch) | |
tree | 537904f86a8afbf17c69c912c31be70026c6fca7 /jstests/replsets | |
parent | 235865fc24b459ee8eaea2cd3f3be1257ff9249a (diff) | |
download | mongo-7029641c97ff8de49b7b7fab9d11de54b4e4da59.tar.gz |
rs more rollback testing
Diffstat (limited to 'jstests/replsets')
-rwxr-xr-x | jstests/replsets/rollback3.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/jstests/replsets/rollback3.js b/jstests/replsets/rollback3.js index a42fa6ca12a..d5bc0cd6ecf 100755 --- a/jstests/replsets/rollback3.js +++ b/jstests/replsets/rollback3.js @@ -56,8 +56,13 @@ function dbs_match(a, b) { var c = a.getCollectionNames();
for( var i in c ) {
print("checking " + c[i]);
- if( !friendlyEqual( a[c[i]].find().sort({_id:1}).toArray(), b[c[i]].find().sort({_id:1}).toArray() ) ) {
+ // system.indexes doesn't have _id so the more involved sort here:
+ if (!friendlyEqual(a[c[i]].find().sort({ _id: 1, ns:1, name:1 }).toArray(), b[c[i]].find().sort({ _id: 1, ns:1,name:1 }).toArray())) {
print("dbs_match: collections don't match " + c[i]);
+ if (a[c[i]].count() < 12) {
+ printjson(a[c[i]].find().sort({ _id: 1 }).toArray());
+ printjson(b[c[i]].find().sort({ _id: 1 }).toArray());
+ }
return false;
}
}
@@ -68,6 +73,9 @@ function dbs_match(a, b) { function doInitialWrites(db) {
db.b.insert({ x: 1 });
db.b.ensureIndex({ x: 1 });
+ db.oldname.insert({ y: 1 });
+ db.oldname.insert({ y: 2 });
+ db.oldname.ensureIndex({ y: 1 },true);
t = db.bar;
t.insert({ q:0});
t.insert({ q: 1, a: "foo" });
@@ -83,7 +91,7 @@ function doInitialWrites(db) { }
/* these writes on one primary only and will be rolled back. */
-function doItemsToRollBack(db) {
+function doItemsToRollBack(db) {
t = db.bar;
t.insert({ q: 4 });
t.update({ q: 3 }, { q: 3, rb: true });
@@ -111,6 +119,8 @@ function doItemsToRollBack(db) { // drop an index - verify it comes back
db.b.dropIndexes();
+
+ db.oldname.renameCollection("newname");
}
function doWritesToKeep2(db) {
|