summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDwight <dwight@10gen.com>2010-08-23 15:58:30 -0400
committerDwight <dwight@10gen.com>2010-08-23 15:58:30 -0400
commit235865fc24b459ee8eaea2cd3f3be1257ff9249a (patch)
tree20f5245daa272e7cd43b98510f30e1546a723768
parent1c5a91576dca79170ca3e843b2be50fdcfc33a8e (diff)
downloadmongo-235865fc24b459ee8eaea2cd3f3be1257ff9249a.tar.gz
rs test and fix rollback of deleteindex command 163
-rw-r--r--db/repl/rs_rollback.cpp2
-rwxr-xr-xjstests/replsets/rollback3.js5
2 files changed, 6 insertions, 1 deletions
diff --git a/db/repl/rs_rollback.cpp b/db/repl/rs_rollback.cpp
index 43f0e34a951..2effa395b43 100644
--- a/db/repl/rs_rollback.cpp
+++ b/db/repl/rs_rollback.cpp
@@ -147,7 +147,7 @@ namespace mongo {
h.collectionsToResync.insert(ns);
return;
}
- else if( cmdname == "dropIndexes" ) {
+ else if( cmdname == "dropIndexes" || cmdname == "deleteIndexes" ) {
/* TODO: this is bad. we simply full resync the collection here, which could be very slow. */
log() << "replSet info rollback of dropIndexes is slow in this version of mongod" << rsLog;
string ns = s.db + '.' + first.valuestr();
diff --git a/jstests/replsets/rollback3.js b/jstests/replsets/rollback3.js
index 52e45ce1a19..a42fa6ca12a 100755
--- a/jstests/replsets/rollback3.js
+++ b/jstests/replsets/rollback3.js
@@ -66,6 +66,8 @@ function dbs_match(a, b) {
/* these writes will be initial data and replicate everywhere. */
function doInitialWrites(db) {
+ db.b.insert({ x: 1 });
+ db.b.ensureIndex({ x: 1 });
t = db.bar;
t.insert({ q:0});
t.insert({ q: 1, a: "foo" });
@@ -106,6 +108,9 @@ function doItemsToRollBack(db) {
// drop a collection - we'll need all its data back!
t.drop();
+
+ // drop an index - verify it comes back
+ db.b.dropIndexes();
}
function doWritesToKeep2(db) {