feat: add needed budget and memory budget into the message for us to diagnose and increase our memory budget as needed (#5640)
parent
8b273c2a7d
commit
44e12aa512
|
@ -392,7 +392,10 @@ mod tests {
|
|||
let skipped_compactions = repos.partitions().list_skipped_compactions().await.unwrap();
|
||||
assert_eq!(skipped_compactions.len(), 1);
|
||||
assert_eq!(skipped_compactions[0].partition_id, partition4.partition.id);
|
||||
assert_eq!(skipped_compactions[0].reason, "over memory budget");
|
||||
assert_eq!(
|
||||
skipped_compactions[0].reason,
|
||||
"over memory budget. Needed budget = 15750, memory budget = 13500"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -175,7 +175,8 @@ async fn compact_candidates_with_memory_budget<C, Fut>(
|
|||
}
|
||||
}
|
||||
FilterResult::OverBudget => {
|
||||
if to_compact.budget_bytes() <= compactor.config.memory_budget_bytes {
|
||||
let needed_bytes = to_compact.budget_bytes();
|
||||
if needed_bytes <= compactor.config.memory_budget_bytes {
|
||||
// Required budget is larger than the remaining budget but smaller than
|
||||
// full budget, add this partition back to the end of the list to compact
|
||||
// with full budget later
|
||||
|
@ -186,12 +187,18 @@ async fn compact_candidates_with_memory_budget<C, Fut>(
|
|||
?partition_id,
|
||||
?table_id,
|
||||
compaction_type,
|
||||
?needed_bytes,
|
||||
memory_budget_bytes = compactor.config.memory_budget_bytes,
|
||||
"skipped; over memory budget"
|
||||
);
|
||||
let mut repos = compactor.catalog.repositories().await;
|
||||
let reason = format!(
|
||||
"over memory budget. Needed budget = {}, memory budget = {}",
|
||||
needed_bytes, compactor.config.memory_budget_bytes
|
||||
);
|
||||
let record_skip = repos
|
||||
.partitions()
|
||||
.record_skipped_compaction(partition_id, "over memory budget")
|
||||
.record_skipped_compaction(partition_id, &reason)
|
||||
.await;
|
||||
if let Err(e) = record_skip {
|
||||
warn!(?partition_id, %e, "could not log skipped compaction");
|
||||
|
|
Loading…
Reference in New Issue