Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow received to outpace window, we're already constraining repair #911

Merged
merged 1 commit into from
Aug 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/crdt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,7 @@ impl Crdt {
let out = entry.to_blob(
blob_recycler,
Some(ix),
Some(from.id),
Some(me.id), // causes retransmission if I'm the leader
Some(&from.contact_info.tvu_window),
);

Expand Down
4 changes: 2 additions & 2 deletions src/streamer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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, none of the packets it receives fits in the window
// 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 {
trace!(
Expand Down Expand Up @@ -1155,7 +1155,7 @@ mod test {
);
assert_eq!(
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));

Expand Down