import org.opendaylight.controller.cluster.access.commands.DestroyLocalHistoryRequest;
import org.opendaylight.controller.cluster.access.commands.LocalHistoryRequest;
import org.opendaylight.controller.cluster.access.commands.LocalHistorySuccess;
-import org.opendaylight.controller.cluster.access.commands.OutOfOrderRequestException;
+import org.opendaylight.controller.cluster.access.commands.OutOfSequenceEnvelopeException;
import org.opendaylight.controller.cluster.access.commands.PurgeLocalHistoryRequest;
import org.opendaylight.controller.cluster.access.commands.TransactionRequest;
import org.opendaylight.controller.cluster.access.commands.TransactionSuccess;
return clientId;
}
- private void checkRequestSequence(final RequestEnvelope envelope) throws OutOfOrderRequestException {
+ private void checkRequestSequence(final RequestEnvelope envelope) throws OutOfSequenceEnvelopeException {
if (expectedTxSequence != envelope.getTxSequence()) {
- throw new OutOfOrderRequestException(expectedTxSequence);
+ throw new OutOfSequenceEnvelopeException(expectedTxSequence);
}
}
} else if (request instanceof PurgeLocalHistoryRequest) {
return handlePurgeHistory((PurgeLocalHistoryRequest)request, envelope, now);
} else {
+ LOG.warn("{}: rejecting unsupported request {}", persistenceId, request);
throw new UnsupportedRequestException(request);
}
} finally {
// end up resurrecting a purged history.
if (purgedHistories.contains(UnsignedLong.fromLongBits(id.getHistoryId()))) {
LOG.debug("{}: rejecting purged request {}", persistenceId, request);
- throw new DeadHistoryException(lastSeenHistory.longValue());
+ throw new DeadHistoryException(purgedHistories);
}
// Update last history we have seen
if (lhId.getHistoryId() != 0) {
history = localHistories.get(lhId);
if (history == null) {
- LOG.debug("{}: rejecting unknown history request {}", persistenceId, request);
+ if (purgedHistories.contains(UnsignedLong.fromLongBits(lhId.getHistoryId()))) {
+ LOG.warn("{}: rejecting request {} to purged history", persistenceId, request);
+ throw new DeadHistoryException(purgedHistories);
+ }
+
+ LOG.warn("{}: rejecting unknown history request {}", persistenceId, request);
throw new UnknownHistoryException(lastSeenHistory);
}
} else {