/** Update my own digest from a digest received by somebody else. Returns whether the update was successful. * Needs to be called with a lock on digest */ @GuardedBy("lock") protected void updateLocalDigest(Digest d, Address sender) { StringBuilder sb=null; if(log.isTraceEnabled()) sb=new StringBuilder().append(local_addr).append(": handling digest from ").append(sender).append(":\nmine: ") .append(printDigest(digest)).append("\nother: ").append(printDigest(d)); for(Digest.Entry entry: d) { Address mbr=entry.getMember(); long hd=entry.getHighestDeliveredSeqno(), hr=entry.getHighestReceivedSeqno(); // compute the minimum of the highest seqnos deliverable (for garbage collection) long[] seqnos=digest.get(mbr); if(seqnos == null) continue; long my_hd=seqnos[0]; long my_hr=seqnos[1]; // (for retransmission of last missing message) if(my_hd == -1) // -1 means the seqno hasn't been set yet my_hd=hd; long new_hd=Math.min(my_hd, hd); long new_hr=Math.max(my_hr, hr); digest.set(mbr, new_hd, new_hr); } if(sb != null) // implies log.isTraceEnabled() == true log.trace(sb.append("\nresult: ").append(printDigest(digest)).append("\n")); }
log.trace("%s: received stability msg from %s: %s", local_addr, sender, printDigest(stable_digest));
protected void _sendStabilityMessage(Digest stability_digest, final ViewId view_id) { if(suspended) { log.debug("STABILITY message will not be sent as suspended=%b", suspended); return; } // https://issues.jboss.org/browse/JGRP-1638: we reverted to sending the STABILITY message *unreliably*, // but clear votes *before* sending it try { Message msg=new Message().setFlag(Message.Flag.OOB, Message.Flag.INTERNAL, Message.Flag.NO_RELIABILITY) .putHeader(id, new StableHeader(StableHeader.STABILITY, view_id)) .setBuffer(marshal(stability_digest)); log.trace("%s: sending stability msg %s", local_addr, printDigest(stability_digest)); num_stability_msgs_sent++; down_prot.down(msg); } catch(Exception e) { log.warn("failed sending STABILITY message", e); } }
local_addr, (send_stable_msgs_to_coord_only? coordinator : "cluster"), printDigest(d)); else { log.trace("%s: could not find matching digest for view %s, missing members: %s", local_addr, current_view, d.getNonSetMembers());
/** Update my own digest from a digest received by somebody else. Returns whether the update was successful. * Needs to be called with a lock on digest */ @GuardedBy("lock") protected void updateLocalDigest(Digest d, Address sender) { StringBuilder sb=null; if(log.isTraceEnabled()) sb=new StringBuilder().append(local_addr).append(": handling digest from ").append(sender).append(":\nmine: ") .append(printDigest(digest)).append("\nother: ").append(printDigest(d)); for(Digest.Entry entry: d) { Address mbr=entry.getMember(); long hd=entry.getHighestDeliveredSeqno(), hr=entry.getHighestReceivedSeqno(); // compute the minimum of the highest seqnos deliverable (for garbage collection) long[] seqnos=digest.get(mbr); if(seqnos == null) continue; long my_hd=seqnos[0]; long my_hr=seqnos[1]; // (for retransmission of last missing message) if(my_hd == -1) // -1 means the seqno hasn't been set yet my_hd=hd; long new_hd=Math.min(my_hd, hd); long new_hr=Math.max(my_hr, hr); digest.set(mbr, new_hd, new_hr); } if(sb != null) // implies log.isTraceEnabled() == true log.trace(sb.append("\nresult: ").append(printDigest(digest)).append("\n")); }
log.trace("%s: received stability msg from %s: %s", local_addr, sender, printDigest(stable_digest));
protected void _sendStabilityMessage(Digest stability_digest, final ViewId view_id) { if(suspended) { log.debug("STABILITY message will not be sent as suspended=%b", suspended); return; } // https://issues.jboss.org/browse/JGRP-1638: we reverted to sending the STABILITY message *unreliably*, // but clear votes *before* sending it try { Message msg=new Message().setFlag(Message.Flag.OOB, Message.Flag.INTERNAL, Message.Flag.NO_RELIABILITY) .putHeader(id, new StableHeader(StableHeader.STABILITY, view_id)) .setBuffer(marshal(stability_digest)); log.trace("%s: sending stability msg %s", local_addr, printDigest(stability_digest)); num_stability_msgs_sent++; down_prot.down(msg); } catch(Exception e) { log.warn("failed sending STABILITY message", e); } }
local_addr, (send_stable_msgs_to_coord_only? coordinator : "cluster"), printDigest(d)); else { log.trace("%s: could not find matching digest for view %s, missing members: %s", local_addr, current_view, d.getNonSetMembers());