mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-27 01:50:38 +00:00
code cleanup
This commit is contained in:
@@ -379,15 +379,10 @@ pub async fn calculate_synthetic_size_worker(
|
||||
continue;
|
||||
}
|
||||
|
||||
match mgr::get_tenant(tenant_id, true).await
|
||||
if let Ok(tenant) = mgr::get_tenant(tenant_id, true).await
|
||||
{
|
||||
Ok(tenant) => {
|
||||
if let Err(e) = tenant.calculate_synthetic_size().await {
|
||||
error!("failed to calculate synthetic size for tenant {}: {}", tenant_id, e);
|
||||
}
|
||||
},
|
||||
Err(err) => {
|
||||
error!("tenant {} is not found: {err:?}", tenant_id);
|
||||
if let Err(e) = tenant.calculate_synthetic_size().await {
|
||||
error!("failed to calculate synthetic size for tenant {}: {}", tenant_id, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,6 @@ struct TimelineInputs {
|
||||
// need to sort them in the tree order.
|
||||
//
|
||||
// see updates_sort_with_branches_at_same_lsn test below
|
||||
|
||||
fn sort_updates_in_tree_order(updates: Vec<Update>) -> anyhow::Result<Vec<Update>> {
|
||||
let mut sorted_updates = Vec::with_capacity(updates.len());
|
||||
let mut known_timelineids = HashSet::new();
|
||||
@@ -380,6 +379,8 @@ pub(super) async fn gather_inputs(
|
||||
// handled by the variant order in `Command`.
|
||||
//
|
||||
updates.sort_unstable();
|
||||
// And another sort to handle Command::BranchFrom ordering
|
||||
// in case when there are multiple branches at the same LSN.
|
||||
let sorted_updates = sort_updates_in_tree_order(updates)?;
|
||||
|
||||
let retention_period = match max_cutoff_distance {
|
||||
|
||||
Reference in New Issue
Block a user