Skip to content
Browse files

Log more information on message divergence

  • Loading branch information...
1 parent d33d26e commit 32de19c88c132c6a59a2e5fd649be4828b2559d0 @dgomezferro committed Sep 28, 2012
View
11 src/main/java/com/yahoo/pasc/paxos/client/ReplyStore.java
@@ -24,6 +24,7 @@
import com.yahoo.pasc.CloneableDeep;
import com.yahoo.pasc.EqualsDeep;
+import com.yahoo.pasc.paxos.messages.Reply;
public class ReplyStore implements CloneableDeep<ReplyStore>, EqualsDeep<ReplyStore> {
@@ -42,20 +43,20 @@ public ReplyStore(int servers) {
this.size = 0;
}
- public void addRemote(int senderId, byte[] reply) {
+ public void addRemote(int senderId, Reply reply) {
if (!senders.get(senderId)) {
senders.set(senderId);
int i = 0;
for (; i < size; ++i) {
- if (Arrays.equals(replies[i], reply)) {
+ if (Arrays.equals(replies[i], reply.getValue())) {
counts[i]++;
return;
} else {
- LOG.warn("State divergence adding reply. \n Stored: {} \n Received: {}",
- Arrays.toString(replies[i]), Arrays.toString(reply));
+ LOG.warn("State divergence adding reply. \n Stored: {} \n Received: {} \n Reply: {}",
+ new Object[] {Arrays.toString(replies[i]), Arrays.toString(reply.getValue()), reply});
}
}
- replies[i] = reply;
+ replies[i] = reply.getValue();
counts[i] = 1;
size++;
}
View
2 src/main/java/com/yahoo/pasc/paxos/client/handlers/ReplyHandler.java
@@ -49,7 +49,7 @@ public boolean guardPredicate(Reply receivedMessage) {
// Already delivered message
return null;
}
- store.addRemote(reply.getServerId(), reply.getValue());
+ store.addRemote(reply.getServerId(), reply);
byte[] value = store.getStableReply(quorum);
if (value != null) {
descriptors = Arrays.asList(new Received.Descriptor(value));

0 comments on commit 32de19c

Please sign in to comment.
Something went wrong with that request. Please try again.