mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 01:21:03 +01:00
more robust maintenance of mod ids set in repl code
This commit is contained in:
parent
f9c896224b
commit
b8c6d85506
12
db/repl.cpp
12
db/repl.cpp
@ -953,13 +953,11 @@ namespace mongo {
|
||||
BSONObj id = idForOp( op, mod );
|
||||
if ( !id.isEmpty() ) {
|
||||
const char *ns = op.getStringField( "ns" );
|
||||
if ( mod ) {
|
||||
if ( !idTracker.haveId( ns, id ) ) {
|
||||
idTracker.haveModId( ns, id, true );
|
||||
}
|
||||
} else {
|
||||
idTracker.haveModId( ns, id, false );
|
||||
}
|
||||
// Since our range of local ops may not be the same as our peer's
|
||||
// range of unapplied ops, it is always necessary to rewrite objects
|
||||
// to the oplog after a mod update.
|
||||
if ( mod )
|
||||
idTracker.haveModId( ns, id, true );
|
||||
idTracker.haveId( ns, id, true );
|
||||
}
|
||||
}
|
||||
|
@ -71,8 +71,8 @@ doTest = function( recover, newMaster, newSlave ) {
|
||||
// start normally
|
||||
connect();
|
||||
a = new MongodRunner( aPort, "/data/db/" + baseName + "-arbiter" );
|
||||
l = new MongodRunner( lPort, "/data/db/" + baseName + "-left", "127.0.0.1:" + rpPort, "127.0.0.1:" + aPort, "-vvvvvv" );
|
||||
r = new MongodRunner( rPort, "/data/db/" + baseName + "-right", "127.0.0.1:" + lpPort, "127.0.0.1:" + aPort, "-vvvvvv" );
|
||||
l = new MongodRunner( lPort, "/data/db/" + baseName + "-left", "127.0.0.1:" + rpPort, "127.0.0.1:" + aPort );
|
||||
r = new MongodRunner( rPort, "/data/db/" + baseName + "-right", "127.0.0.1:" + lpPort, "127.0.0.1:" + aPort );
|
||||
pair = new ReplPair( l, r, a );
|
||||
pair.start();
|
||||
pair.waitForSteadyState();
|
||||
|
Loading…
Reference in New Issue
Block a user