use of org.apache.cassandra.repair.messages.FailSession in project cassandra by apache.
the class LocalSessionTest method prepareWithNonExistantParentSession.
/**
* If a ParentRepairSession wasn't previously created, we shouldn't
* create a session locally, but we should send a failure message to
* the coordinator.
*/
@Test
public void prepareWithNonExistantParentSession() {
UUID sessionID = UUIDGen.getTimeUUID();
InstrumentedLocalSessions sessions = new InstrumentedLocalSessions();
sessions.handlePrepareMessage(PARTICIPANT1, new PrepareConsistentRequest(sessionID, COORDINATOR, PARTICIPANTS));
Assert.assertNull(sessions.getSession(sessionID));
assertMessagesSent(sessions, COORDINATOR, new FailSession(sessionID));
}
use of org.apache.cassandra.repair.messages.FailSession in project cassandra by apache.
the class LocalSessions method handleFinalizeProposeMessage.
public void handleFinalizeProposeMessage(InetAddress from, FinalizePropose propose) {
logger.debug("received {} from {}", propose, from);
UUID sessionID = propose.sessionID;
LocalSession session = getSession(sessionID);
if (session == null) {
logger.debug("No LocalSession found for session {}, responding with failure", sessionID);
sendMessage(from, new FailSession(sessionID));
return;
}
try {
setStateAndSave(session, FINALIZE_PROMISED);
sendMessage(from, new FinalizePromise(sessionID, getBroadcastAddress(), true));
} catch (IllegalArgumentException e) {
logger.error("error setting session to FINALIZE_PROMISED", e);
failSession(sessionID);
}
}
Aggregations