remove replicode in run_purge_batch() (#5630)
* remove replicode * bigger timeout * backout 90 min timeout
This commit is contained in:
parent
2c7f49c3e6
commit
615da845cd
|
@ -234,116 +234,48 @@ impl Blocktree {
|
||||||
|
|
||||||
// Returns whether or not all iterators have reached their end
|
// Returns whether or not all iterators have reached their end
|
||||||
fn run_purge_batch(&self, from_slot: Slot, batch_end: Slot) -> Result<bool> {
|
fn run_purge_batch(&self, from_slot: Slot, batch_end: Slot) -> Result<bool> {
|
||||||
let mut end = true;
|
|
||||||
let from_slot = Some(from_slot);
|
let from_slot = Some(from_slot);
|
||||||
let batch_end = Some(batch_end);
|
let batch_end = Some(batch_end);
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
let mut batch_processor = self.db.batch_processor();
|
let mut batch_processor = self.db.batch_processor();
|
||||||
let mut write_batch = batch_processor
|
let mut write_batch = batch_processor
|
||||||
.batch()
|
.batch()
|
||||||
.expect("Database Error: Failed to get write batch");
|
.expect("Database Error: Failed to get write batch");
|
||||||
end &= match self
|
let end = self
|
||||||
.meta_cf
|
.meta_cf
|
||||||
.delete_slot(&mut write_batch, from_slot, batch_end)
|
.delete_slot(&mut write_batch, from_slot, batch_end)
|
||||||
{
|
.unwrap_or(false)
|
||||||
Ok(finished) => finished,
|
&& self
|
||||||
Err(e) => {
|
.data_cf
|
||||||
error!(
|
.delete_slot(&mut write_batch, from_slot, batch_end)
|
||||||
"Error: {:?} while deleting meta_cf for slot {:?}",
|
.unwrap_or(false)
|
||||||
e, from_slot
|
&& self
|
||||||
);
|
.erasure_meta_cf
|
||||||
false
|
.delete_slot(&mut write_batch, from_slot, batch_end)
|
||||||
}
|
.unwrap_or(false)
|
||||||
};
|
&& self
|
||||||
end &= match self
|
.erasure_cf
|
||||||
.data_cf
|
.delete_slot(&mut write_batch, from_slot, batch_end)
|
||||||
.delete_slot(&mut write_batch, from_slot, batch_end)
|
.unwrap_or(false)
|
||||||
{
|
&& self
|
||||||
Ok(finished) => finished,
|
.orphans_cf
|
||||||
Err(e) => {
|
.delete_slot(&mut write_batch, from_slot, batch_end)
|
||||||
error!(
|
.unwrap_or(false)
|
||||||
"Error: {:?} while deleting meta_cf for slot {:?}",
|
&& self
|
||||||
e, from_slot
|
.index_cf
|
||||||
);
|
.delete_slot(&mut write_batch, from_slot, batch_end)
|
||||||
false
|
.unwrap_or(false)
|
||||||
}
|
&& self
|
||||||
};
|
.dead_slots_cf
|
||||||
end &= match self
|
.delete_slot(&mut write_batch, from_slot, batch_end)
|
||||||
.erasure_meta_cf
|
.unwrap_or(false)
|
||||||
.delete_slot(&mut write_batch, from_slot, batch_end)
|
&& self
|
||||||
{
|
.db
|
||||||
Ok(finished) => finished,
|
.column::<cf::Root>()
|
||||||
Err(e) => {
|
.delete_slot(&mut write_batch, from_slot, batch_end)
|
||||||
error!(
|
.unwrap_or(false);
|
||||||
"Error: {:?} while deleting meta_cf for slot {:?}",
|
|
||||||
e, from_slot
|
|
||||||
);
|
|
||||||
false
|
|
||||||
}
|
|
||||||
};
|
|
||||||
end &= match self
|
|
||||||
.erasure_cf
|
|
||||||
.delete_slot(&mut write_batch, from_slot, batch_end)
|
|
||||||
{
|
|
||||||
Ok(finished) => finished,
|
|
||||||
Err(e) => {
|
|
||||||
error!(
|
|
||||||
"Error: {:?} while deleting meta_cf for slot {:?}",
|
|
||||||
e, from_slot
|
|
||||||
);
|
|
||||||
false
|
|
||||||
}
|
|
||||||
};
|
|
||||||
end &= match self
|
|
||||||
.orphans_cf
|
|
||||||
.delete_slot(&mut write_batch, from_slot, batch_end)
|
|
||||||
{
|
|
||||||
Ok(finished) => finished,
|
|
||||||
Err(e) => {
|
|
||||||
error!(
|
|
||||||
"Error: {:?} while deleting meta_cf for slot {:?}",
|
|
||||||
e, from_slot
|
|
||||||
);
|
|
||||||
false
|
|
||||||
}
|
|
||||||
};
|
|
||||||
end &= match self
|
|
||||||
.index_cf
|
|
||||||
.delete_slot(&mut write_batch, from_slot, batch_end)
|
|
||||||
{
|
|
||||||
Ok(finished) => finished,
|
|
||||||
Err(e) => {
|
|
||||||
error!(
|
|
||||||
"Error: {:?} while deleting meta_cf for slot {:?}",
|
|
||||||
e, from_slot
|
|
||||||
);
|
|
||||||
false
|
|
||||||
}
|
|
||||||
};
|
|
||||||
end &= match self
|
|
||||||
.dead_slots_cf
|
|
||||||
.delete_slot(&mut write_batch, from_slot, batch_end)
|
|
||||||
{
|
|
||||||
Ok(finished) => finished,
|
|
||||||
Err(e) => {
|
|
||||||
error!(
|
|
||||||
"Error: {:?} while deleting meta_cf for slot {:?}",
|
|
||||||
e, from_slot
|
|
||||||
);
|
|
||||||
false
|
|
||||||
}
|
|
||||||
};
|
|
||||||
let roots_cf = self.db.column::<cf::Root>();
|
|
||||||
end &= match roots_cf.delete_slot(&mut write_batch, from_slot, batch_end) {
|
|
||||||
Ok(finished) => finished,
|
|
||||||
Err(e) => {
|
|
||||||
error!(
|
|
||||||
"Error: {:?} while deleting meta_cf for slot {:?}",
|
|
||||||
e, from_slot
|
|
||||||
);
|
|
||||||
false
|
|
||||||
}
|
|
||||||
};
|
|
||||||
if let Err(e) = batch_processor.write(write_batch) {
|
if let Err(e) = batch_processor.write(write_batch) {
|
||||||
error!(
|
error!(
|
||||||
"Error: {:?} while submitting write batch for slot {:?} retrying...",
|
"Error: {:?} while submitting write batch for slot {:?} retrying...",
|
||||||
|
|
|
@ -439,7 +439,12 @@ where
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if let Err(e) = batch.delete::<C>(index) {
|
if let Err(e) = batch.delete::<C>(index) {
|
||||||
error!("Error: {:?} while adding delete to batch {:?}", e, C::NAME)
|
error!(
|
||||||
|
"Error: {:?} while adding delete from_slot {:?} to batch {:?}",
|
||||||
|
e,
|
||||||
|
from,
|
||||||
|
C::NAME
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ok(end)
|
Ok(end)
|
||||||
|
|
Loading…
Reference in New Issue