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