@@ -139,17 +139,19 @@ private SessionID prime(ServerID node) {
139
139
Assert .assertFalse (node .isNull ());
140
140
SessionID current = passiveNodes .get (node );
141
141
// no session means we are allowed to proceed
142
- if (current == null && serverIsValid ( node ) ) {
142
+ if (current == null ) {
143
143
if (!consistencyMgr .requestTransition (ServerMode .ACTIVE , node , ConsistencyManager .Transition .ADD_PASSIVE )) {
144
144
serverCheck .zapNode (node , L2HAZapNodeRequestProcessor .SPLIT_BRAIN , "unable to verify active" );
145
145
return SessionID .NULL_ID ;
146
146
} else {
147
- LOGGER .debug ("Starting message sequence on " + node );
147
+ LOGGER .info ("Starting message sequence on " + node );
148
148
SessionID newSession = new SessionID (sessionMaker .incrementAndGet ());
149
149
if (passiveNodes .putIfAbsent (node , newSession ) == null ) {
150
- boolean sent = this .replicationSender .addPassive (node , newSession , executionLane (newSession ), SyncReplicationActivity .createStartMessage ());
151
- Assert .assertTrue (sent );
152
- return newSession ;
150
+ if (this .replicationSender .addPassive (node , newSession , executionLane (newSession ), SyncReplicationActivity .createStartMessage ())) {
151
+ return newSession ;
152
+ } else {
153
+ passiveNodes .remove (node , newSession );
154
+ }
153
155
}
154
156
}
155
157
}
@@ -178,12 +180,8 @@ public boolean startPassiveSync(ServerID newNode) {
178
180
executePassiveSync (newNode , session );
179
181
return true ;
180
182
} else {
181
- if (!passiveNodes .containsKey (newNode )) {
182
- LOGGER .info ("passive node {} to requesting prime is no longer a valid passive" , newNode );
183
- } else {
184
- LOGGER .info ("unable to prime connection to {} for passive sync" , newNode );
185
- serverCheck .closeMember (newNode );
186
- }
183
+ LOGGER .info ("unable to prime connection to {} for passive sync" , newNode );
184
+ serverCheck .closeMember (newNode );
187
185
return false ;
188
186
}
189
187
}
0 commit comments