allow received to outpace window, we're already constraining repair
correctly identify sender in ledger_window repair responses, enabling re-transmission
This commit is contained in:
@@ -1025,7 +1025,7 @@ impl Crdt {
|
|||||||
let out = entry.to_blob(
|
let out = entry.to_blob(
|
||||||
blob_recycler,
|
blob_recycler,
|
||||||
Some(ix),
|
Some(ix),
|
||||||
Some(from.id),
|
Some(me.id), // causes retransmission if I'm the leader
|
||||||
Some(&from.contact_info.tvu_window),
|
Some(&from.contact_info.tvu_window),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -460,7 +460,7 @@ fn blob_idx_in_window(debug_id: u64, pix: u64, consumed: u64, received: &mut u64
|
|||||||
// the window. The worst case here is the server *starts* outside
|
// the window. The worst case here is the server *starts* outside
|
||||||
// the window, none of the packets it receives fits in the window
|
// the window, none of the packets it receives fits in the window
|
||||||
// and repair requests (which are based on received) are never generated
|
// and repair requests (which are based on received) are never generated
|
||||||
*received = cmp::min(consumed + WINDOW_SIZE, cmp::max(pix, *received));
|
*received = cmp::max(pix, *received);
|
||||||
|
|
||||||
if pix >= consumed + WINDOW_SIZE {
|
if pix >= consumed + WINDOW_SIZE {
|
||||||
trace!(
|
trace!(
|
||||||
@@ -1155,7 +1155,7 @@ mod test {
|
|||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
wrap_blob_idx_in_window(0, 91 + WINDOW_SIZE, 90, 100),
|
wrap_blob_idx_in_window(0, 91 + WINDOW_SIZE, 90, 100),
|
||||||
(false, 90 + WINDOW_SIZE)
|
(false, 91 + WINDOW_SIZE)
|
||||||
);
|
);
|
||||||
assert_eq!(wrap_blob_idx_in_window(0, 89, 90, 100), (false, 100));
|
assert_eq!(wrap_blob_idx_in_window(0, 89, 90, 100), (false, 100));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user