From 38d306114392264918a4af8d863391879eabcb47 Mon Sep 17 00:00:00 2001 From: Christian Schwarz Date: Tue, 28 Mar 2023 11:32:21 +0200 Subject: [PATCH] add comment on not-need to be 100% accurate about max_layer_size --- pageserver/src/disk_usage_eviction_task.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pageserver/src/disk_usage_eviction_task.rs b/pageserver/src/disk_usage_eviction_task.rs index c0ee42066b..719e69000f 100644 --- a/pageserver/src/disk_usage_eviction_task.rs +++ b/pageserver/src/disk_usage_eviction_task.rs @@ -506,6 +506,10 @@ async fn extend_lru_candidates( return ControlFlow::Break(()); } + // If one of the timelines becomes `!is_active()` during the iteration, + // for example because we're shutting down, then `max_layer_size` can be too small. + // That's OK. This code only runs under a disk pressure situation, and being + // a little unfair to tenants during shutdown in such a situation is tolerable. let mut max_layer_size: Option = None; for tl in tenant.list_timelines() { if !tl.is_active() {