Merge branch 'release-5.2' of github.com:etschannen/foundationdb into release-5.2-leaks
This commit is contained in:
commit
acee7eef1b
|
@ -211,19 +211,31 @@ ACTOR Future<Void> leaderRegister(LeaderElectionRegInterface interf, Key key) {
|
|||
|
||||
loop choose {
|
||||
when ( GetLeaderRequest req = waitNext( interf.getLeader.getFuture() ) ) {
|
||||
if (currentNominee.present() && currentNominee.get().changeID != req.knownLeader)
|
||||
if (currentNominee.present() && currentNominee.get().changeID != req.knownLeader) {
|
||||
req.reply.send( currentNominee.get() );
|
||||
else
|
||||
} else {
|
||||
notify.push_back( req.reply );
|
||||
if(notify.size() > SERVER_KNOBS->MAX_NOTIFICATIONS) {
|
||||
for(int i=0; i<notify.size(); i++)
|
||||
notify[i].send( currentNominee.get() );
|
||||
notify.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
when ( CandidacyRequest req = waitNext( interf.candidacy.getFuture() ) ) {
|
||||
//TraceEvent("CandidacyRequest").detail("Nominee", req.myInfo.changeID );
|
||||
availableCandidates.erase( LeaderInfo(req.prevChangeID) );
|
||||
availableCandidates.insert( req.myInfo );
|
||||
if (currentNominee.present() && currentNominee.get().changeID != req.knownLeader)
|
||||
if (currentNominee.present() && currentNominee.get().changeID != req.knownLeader) {
|
||||
req.reply.send( currentNominee.get() );
|
||||
else
|
||||
} else {
|
||||
notify.push_back( req.reply );
|
||||
if(notify.size() > SERVER_KNOBS->MAX_NOTIFICATIONS) {
|
||||
for(int i=0; i<notify.size(); i++)
|
||||
notify[i].send( currentNominee.get() );
|
||||
notify.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
when (LeaderHeartbeatRequest req = waitNext( interf.leaderHeartbeat.getFuture() ) ) {
|
||||
//TODO: use notify to only send a heartbeat once per interval
|
||||
|
@ -237,6 +249,7 @@ ACTOR Future<Void> leaderRegister(LeaderElectionRegInterface interf, Key key) {
|
|||
newInfo.serializedInfo = req.conn.toString();
|
||||
for(int i=0; i<notify.size(); i++)
|
||||
notify[i].send( newInfo );
|
||||
notify.clear();
|
||||
req.reply.send( Void() );
|
||||
return Void();
|
||||
}
|
||||
|
@ -425,4 +438,4 @@ ACTOR Future<Void> coordinationServer(std::string dataFolder) {
|
|||
TraceEvent("CoordinationServerError", myID).error(e, true);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -202,6 +202,7 @@ ServerKnobs::ServerKnobs(bool randomize, ClientKnobs* clientKnobs) {
|
|||
|
||||
// Leader election
|
||||
bool longLeaderElection = randomize && BUGGIFY;
|
||||
init( MAX_NOTIFICATIONS, 100000 );
|
||||
init( CANDIDATE_MIN_DELAY, 0.05 );
|
||||
init( CANDIDATE_MAX_DELAY, 1.0 );
|
||||
init( CANDIDATE_GROWTH_RATE, 1.2 );
|
||||
|
|
|
@ -149,6 +149,7 @@ public:
|
|||
int SPRING_CLEANING_MAX_VACUUM_PAGES;
|
||||
|
||||
// Leader election
|
||||
int MAX_NOTIFICATIONS;
|
||||
double CANDIDATE_MIN_DELAY;
|
||||
double CANDIDATE_MAX_DELAY;
|
||||
double CANDIDATE_GROWTH_RATE;
|
||||
|
|
Loading…
Reference in New Issue