summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristina <kristina@10gen.com>2011-03-11 16:24:01 -0500
committerEliot Horowitz <eliot@10gen.com>2011-03-13 01:33:16 -0500
commit2ad98fd1fa41b51f89e14c3c3b655f788564b09a (patch)
treee53c996db79fb4329bf4431c12379787e5e68351
parent742349b0184a97ec31f99b32551035f0b8ef0b83 (diff)
downloadmongo-2ad98fd1fa41b51f89e14c3c3b655f788564b09a.tar.gz
fix fastsync to not be confused on new members SERVER-2717
-rw-r--r--db/repl/rs.cpp5
-rw-r--r--jstests/replsets/fastsync.js14
2 files changed, 5 insertions, 14 deletions
diff --git a/db/repl/rs.cpp b/db/repl/rs.cpp
index c776f46139e..90ed9f4ce98 100644
--- a/db/repl/rs.cpp
+++ b/db/repl/rs.cpp
@@ -23,6 +23,7 @@
#include "../../s/d_logic.h"
#include "rs.h"
#include "connections.h"
+#include "../repl.h"
namespace mongo {
@@ -380,6 +381,10 @@ namespace mongo {
conn.setTimeout(c.ho.heartbeatTimeoutMillis/1000.0);
}
if( me == 0 ) {
+ // initial startup with fastsync
+ if (!reconf && replSettings.fastsync) {
+ return false;
+ }
// log() << "replSet config : " << _cfg->toString() << rsLog;
log() << "replSet error self not present in the repl set configuration:" << rsLog;
log() << c.toString() << rsLog;
diff --git a/jstests/replsets/fastsync.js b/jstests/replsets/fastsync.js
index 86773e13255..d7c39052ce7 100644
--- a/jstests/replsets/fastsync.js
+++ b/jstests/replsets/fastsync.js
@@ -73,21 +73,7 @@ print("total in foo: "+foo.bar.count());
print("2");
admin.runCommand( {fsync:1,lock:1} );
-
copyDbpath( basePath + "-p", basePath + "-s" );
-
-print("remove local files or slave will get confused");
-var files = listFiles(basePath+"-s");
-
-for (var i in files) {
- var filename = files[i].name;
- if (filename.match("/local")) {
- print("removing "+filename);
- removeFile(filename);
- }
-}
-//run("rm", basePath+"-s/local.*");
-
admin.$cmd.sys.unlock.findOne();