提交 2c7187bf 编写于 作者: L liquidsnake@sapo.pt

Copied fixes from branche to main trunk, part 4

上级 42a67680
......@@ -164,7 +164,8 @@ public final class ExecutionManager {
//process stopped messages
while (!stoppedMsgs.isEmpty()) {
acceptor.processMessage(stoppedMsgs.remove());
PaxosMessage pm = stoppedMsgs.remove();
if (pm.getNumber() > tomLayer.getLastExec()) acceptor.processMessage(pm);
}
stoppedMsgsLock.unlock();
Logger.println("(ExecutionManager.restart) Finished stopped messages processing");
......
......@@ -290,7 +290,8 @@ public final class Acceptor {
* @param value The decided value (got from WEAK or STRONG messages)
*/
private void decide(Round round, byte[] value) {
round.getExecution().getLearner().firstMessageProposed.decisionTime = System.nanoTime();
if (round.getExecution().getLearner().firstMessageProposed != null)
round.getExecution().getLearner().firstMessageProposed.decisionTime = System.nanoTime();
leaderModule.decided(round.getExecution().getId(),
tomLayer.lm.getCurrentLeader()/*leaderModule.getLeader(round.getExecution().getId(),
......
......@@ -173,27 +173,29 @@ public final class DeliveryThread extends Thread {
Logger.println("(DeliveryThread.run) Consensus " + cons.getId() + " was delivered.");
TOMMessage[] requests = extractMessagesFromDecision(cons);
//cons.firstMessageProposed contains the performance counters
if (requests[0].equals(cons.firstMessageProposed)) {
requests[0] = cons.firstMessageProposed;
}
//clean the ordered messages from the pending buffer
tomLayer.clientsManager.requestsOrdered(requests);
deliverMessages(cons.getId(), tomLayer.getLCManager().getLastReg(), true, requests, cons.getDecision());
//******* EDUARDO BEGIN **************//
if (manager.hasUpdates()) {
processReconfigMessages(cons.getId(), cons.getDecisionRound().getNumber());
//set this consensus as the last executed
tomLayer.setLastExec(cons.getId());
//define that end of this execution
tomLayer.setInExec(-1);
if (requests != null && requests.length > 0) {
//cons.firstMessageProposed contains the performance counters
if (requests[0].equals(cons.firstMessageProposed)) {
requests[0] = cons.firstMessageProposed;
}
//clean the ordered messages from the pending buffer
tomLayer.clientsManager.requestsOrdered(requests);
deliverMessages(cons.getId(), tomLayer.getLCManager().getLastReg(), true, requests, cons.getDecision());
//******* EDUARDO BEGIN **************//
if (manager.hasUpdates()) {
processReconfigMessages(cons.getId(), cons.getDecisionRound().getNumber());
//set this consensus as the last executed
tomLayer.setLastExec(cons.getId());
//define that end of this execution
tomLayer.setInExec(-1);
}
//******* EDUARDO END **************//
}
//******* EDUARDO END **************//
/** THIS IS JOAO'S CODE, TO HANDLE CHECKPOINTS */
//logDecision(cons);
/********************************************************/
......
......@@ -159,6 +159,7 @@ public abstract class DefaultRecoverable implements Recoverable, BatchExecutable
byte[][] commands = state.getMessageBatch(eid).commands; // take a batch
if (commands == null || commands.length <= 0) continue;
// INUTIL??????
//tomLayer.lm.addLeaderInfo(eid, state.getMessageBatch(eid).round,
// state.getMessageBatch(eid).leader);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册