Add window recovery
This commit is contained in:
committed by
Greg Fitzgerald
parent
0339f90b40
commit
badf5d5412
@ -170,11 +170,18 @@ fn find_next_missing(
|
|||||||
fn repair_window(
|
fn repair_window(
|
||||||
locked_window: &Arc<RwLock<Vec<Option<SharedBlob>>>>,
|
locked_window: &Arc<RwLock<Vec<Option<SharedBlob>>>>,
|
||||||
crdt: &Arc<RwLock<Crdt>>,
|
crdt: &Arc<RwLock<Crdt>>,
|
||||||
|
_recycler: &BlobRecycler,
|
||||||
last: &mut usize,
|
last: &mut usize,
|
||||||
times: &mut usize,
|
times: &mut usize,
|
||||||
consumed: &mut usize,
|
consumed: &mut usize,
|
||||||
received: &mut usize,
|
received: &mut usize,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
|
#[cfg(feature = "erasure")]
|
||||||
|
{
|
||||||
|
if erasure::recover(_recycler, &mut locked_window.write().unwrap(), *consumed).is_err() {
|
||||||
|
info!("erasure::recover failed");
|
||||||
|
}
|
||||||
|
}
|
||||||
let reqs = find_next_missing(locked_window, crdt, consumed, received)?;
|
let reqs = find_next_missing(locked_window, crdt, consumed, received)?;
|
||||||
//exponential backoff
|
//exponential backoff
|
||||||
if *last != *consumed {
|
if *last != *consumed {
|
||||||
@ -353,6 +360,7 @@ pub fn window(
|
|||||||
let _ = repair_window(
|
let _ = repair_window(
|
||||||
&window,
|
&window,
|
||||||
&crdt,
|
&crdt,
|
||||||
|
&recycler,
|
||||||
&mut last,
|
&mut last,
|
||||||
&mut times,
|
&mut times,
|
||||||
&mut consumed,
|
&mut consumed,
|
||||||
|
Reference in New Issue
Block a user