"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "dso-l2/src/main/java/com/tc/l2/state/StateManagerImpl.java" between
terracotta-core-5.7.0.tar.gz and terracotta-core-5.7.1.tar.gz

About: Terracotta - Clustering technology for Java ("Network Attached Memory", "Distributed Cache"). Source code of the server (5.x) core components.

StateManagerImpl.java  (terracotta-core-5.7.0):StateManagerImpl.java  (terracotta-core-5.7.1)
skipping to change at line 380 skipping to change at line 380
@Override @Override
public void moveToStopState() { public void moveToStopState() {
// noop for now // noop for now
} }
@Override @Override
public synchronized boolean moveToStopStateIf(Set<ServerMode> validStates) { public synchronized boolean moveToStopStateIf(Set<ServerMode> validStates) {
return validStates.contains(this.getCurrentMode()); return validStates.contains(this.getCurrentMode());
} }
private void moveToActiveState(Set<NodeID> passives, Topology topology) { private void moveToActiveState(Set<ServerID> passives, Topology topology) {
ServerMode oldState = switchToState(ServerMode.ACTIVE, EnumSet.of(ServerMode .START, ServerMode.PASSIVE)); ServerMode oldState = switchToState(ServerMode.ACTIVE, EnumSet.of(ServerMode .START, ServerMode.PASSIVE));
// TODO :: If state == START_STATE publish cluster ID // TODO :: If state == START_STATE publish cluster ID
debugInfo("Moving to active state"); debugInfo("Moving to active state");
for (NodeID peer : passives) { for (NodeID peer : passives) {
if (!this.availabilityMgr.requestTransition(state, peer, topology, Consist encyManager.Transition.ADD_PASSIVE)) { if (!this.availabilityMgr.requestTransition(state, peer, topology, Consist encyManager.Transition.ADD_PASSIVE)) {
groupManager.zapNode(peer, L2HAZapNodeRequestProcessor.COMMUNICATION_ERR OR, "unable to add passive"); groupManager.zapNode(peer, L2HAZapNodeRequestProcessor.COMMUNICATION_ERR OR, "unable to add passive");
} }
} }
Enrollment verify = createVerificationEnrollment(); Enrollment verify = createVerificationEnrollment();
electionMgr.declareWinner(verify, oldState.getState()); electionMgr.declareWinner(verify, oldState.getState());
skipping to change at line 504 skipping to change at line 504
} }
} }
private void handleElectionWonMessage(L2StateMessage clusterMsg) { private void handleElectionWonMessage(L2StateMessage clusterMsg) {
debugInfo("Received election_won msg: " + clusterMsg); debugInfo("Received election_won msg: " + clusterMsg);
boolean verify = checkIfPeerWinsVerificationElection(clusterMsg) && !isActiv eCoordinator(); boolean verify = checkIfPeerWinsVerificationElection(clusterMsg) && !isActiv eCoordinator();
boolean transition = verify && availabilityMgr.requestTransition(state, clus terMsg.getEnrollment().getNodeID(), ConsistencyManager.Transition.CONNECT_TO_ACT IVE); boolean transition = verify && availabilityMgr.requestTransition(state, clus terMsg.getEnrollment().getNodeID(), ConsistencyManager.Transition.CONNECT_TO_ACT IVE);
if (transition) { if (transition) {
moveToPassiveReady(clusterMsg); moveToPassiveReady(clusterMsg);
} else { } else {
groupManager.closeMember((ServerID)clusterMsg.messageFrom()); groupManager.closeMember(clusterMsg.messageFrom());
} }
} }
private void handleElectionAlreadyWonMessage(L2StateMessage clusterMsg) { private void handleElectionAlreadyWonMessage(L2StateMessage clusterMsg) {
debugInfo("Received election_already_won msg: " + clusterMsg); debugInfo("Received election_already_won msg: " + clusterMsg);
// if two actives are split-brain and they try and zap each other // if two actives are split-brain and they try and zap each other
// the ZapProcessor will resolve the differences // the ZapProcessor will resolve the differences
if (isActiveCoordinator()) { if (isActiveCoordinator()) {
logger.info("split-brain detected"); logger.info("split-brain detected");
} }
skipping to change at line 655 skipping to change at line 655
logger.info("results not agreed for verification election in state: {}", peerState); logger.info("results not agreed for verification election in state: {}", peerState);
} }
} }
} else { } else {
// result agreed, do nothing // result agreed, do nothing
} }
} }
} }
@Override @Override
public Set<NodeID> getPassiveStandbys() { public Set<ServerID> getPassiveStandbys() {
return electionMgr.passiveStandbys(); return electionMgr.passiveStandbys();
} }
@Override @Override
public void startElectionIfNecessary(NodeID disconnectedNode) { public void startElectionIfNecessary(NodeID disconnectedNode) {
synchronized (this) { synchronized (this) {
synchronizedWaitForStart(); synchronizedWaitForStart();
} }
Assert.assertFalse(disconnectedNode.equals(getLocalNodeID())); Assert.assertFalse(disconnectedNode.equals(getLocalNodeID()));
boolean elect = false; boolean elect = false;
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)