提交 190e639d 编写于 作者: L liquidsnake@sapo.pt

In this commit, I continued to work on the state transfer protocol .I finally...

In this commit, I continued to work on the state transfer protocol .I finally managed to correctly implement the optimization for the revived replica to request the state sooner than the paxos highmark.
上级 951602fc
......@@ -242,6 +242,10 @@ public final class ExecutionManager {
}
System.out.println("Esta a obter estado? " + isRetrievingState);
Logger.println("Recebi uma mensagem do eid " + consId + " do tipo " + type);
Logger.println("Estou no EID " + currentConsId);
Logger.println("Ultimo EID " + lastConsId);
Logger.println("Paxos highmark " + paxosHighMark);
Logger.println("Revival highmark " + revivalHighMark);
boolean canProcessTheMessage = false;
......@@ -252,11 +256,13 @@ public final class ExecutionManager {
// Isto serve para re-direccionar as mensagens para o out of context
// enquanto a replica esta a receber o estado das outras e a actualizar-se
isRetrievingState ||
//(currentConsId == 0 && consId > lastConsId && (consId < (lastConsId + revivalHighMark))) ||
isRetrievingState || // Is this replica retrieving a state?
// Is this not a revived replica?
(!(currentConsId == -1 && lastConsId == -1 && consId >= (lastConsId + revivalHighMark)) &&
/******************************************************************/
(consId > lastConsId && (consId < (lastConsId + paxosHighMark)))
(consId > lastConsId && (consId < (lastConsId + paxosHighMark))))
) { // Is this message within the low and high marks (or maybe is the replica synchronizing) ?
......@@ -293,8 +299,9 @@ public final class ExecutionManager {
}
} else if (
/** ISTO E CODIGO DO JOAO, PARA TRATAR DA TRANSFERENCIA DE ESTADO *
(currentConsId == 0 && consId >= (lastConsId + revivalHighMark)) ||
/** ISTO E CODIGO DO JOAO, PARA TRATAR DA TRANSFERENCIA DE ESTADO */
// Is this replica revived?
(currentConsId == -1 && lastConsId == -1 && consId >= (lastConsId + revivalHighMark)) ||
/******************************************************************/
(consId >= (lastConsId + paxosHighMark))
......
......@@ -48,7 +48,7 @@ public class RandomClient {
int i=0;
//sends 1000 requests to replicas and then terminates
while(i<1000){
while(i<3000){
int argument = generator.nextInt(10000) + 1;
int operator = generator.nextInt(4);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册