Skip to content
Browse files

- Reverted setting seqno on overwriteDigest()

- Setting highest_delivered in win if self
(https://jira.jboss.org/browse/JGRP-1251)
  • Loading branch information...
1 parent bf8a083 commit 23f00a06a9287f65f13c12dfe3746b390dc26566 @belaban committed Nov 17, 2010
Showing with 15 additions and 13 deletions.
  1. +4 −13 src/org/jgroups/protocols/pbcast/NAKACK.java
  2. +11 −0 src/org/jgroups/stack/NakReceiverWindow.java
View
17 src/org/jgroups/protocols/pbcast/NAKACK.java
@@ -1232,7 +1232,6 @@ private void overwriteDigest(Digest digest) {
StringBuilder sb=new StringBuilder("\n[overwriteDigest()]\n");
sb.append("existing digest: " + getDigest()).append("\nnew digest: " + digest);
- boolean set_own_seqno=false;
for(Map.Entry<Address, Digest.Entry> entry: digest.getSenders().entrySet()) {
Address sender=entry.getKey();
Digest.Entry val=entry.getValue();
@@ -1244,25 +1243,17 @@ private void overwriteDigest(Digest digest) {
NakReceiverWindow win=xmit_table.get(sender);
if(win != null) {
+ if(local_addr.equals(sender)) {
+ win.setHighestDelivered(highest_delivered_seqno);
+ continue; // don't destroy my onw window
+ }
win.destroy(); // stops retransmission
xmit_table.remove(sender);
- if(sender.equals(local_addr)) { // Adjust the seqno: https://jira.jboss.org/browse/JGRP-1251
- seqno_lock.lock();
- try {
- seqno=highest_delivered_seqno;
- set_own_seqno=true;
- }
- finally {
- seqno_lock.unlock();
- }
- }
}
win=createNakReceiverWindow(sender, highest_delivered_seqno, low_seqno);
xmit_table.put(sender, win);
}
sb.append("\n").append("resulting digest: " + getDigest());
- if(set_own_seqno)
- sb.append("\nnew seqno for " + local_addr + ": " + seqno);
digest_history.add(sb.toString());
if(log.isDebugEnabled())
log.debug(sb.toString());
View
11 src/org/jgroups/stack/NakReceiverWindow.java
@@ -557,6 +557,17 @@ public long getHighestDelivered() {
}
+ public long setHighestDelivered(long new_val) {
+ lock.writeLock().lock();
+ try {
+ long retval=highest_delivered;
+ highest_delivered=new_val;
+ return retval;
+ }
+ finally {
+ lock.writeLock().unlock();
+ }
+ }
/**

0 comments on commit 23f00a0

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