提交 63142f2d 编写于 作者: J Joao Sousa

Fixed a bug in the state transfer that would happen when the system had only a single replica.

上级 8015ef0d
......@@ -87,8 +87,13 @@ public class StandardStateManager extends BaseStateManager {
//pos = this.SVController.getCurrentViewPos(replica);
//replica = this.SVController.getCurrentViewProcesses()[(pos + 1) % SVController.getCurrentViewN()];
pos = r.nextInt(processes.length);
replica = processes[pos];
if (processes != null && processes.length > 1) {
pos = r.nextInt(processes.length);
replica = processes[pos];
} else {
replica = 0;
break;
}
} while (replica == SVController.getStaticConf().getProcessId());
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册