diff --git a/pageserver/src/http/openapi_spec.yml b/pageserver/src/http/openapi_spec.yml index 1da15a8951..8b35c7e9dc 100644 --- a/pageserver/src/http/openapi_spec.yml +++ b/pageserver/src/http/openapi_spec.yml @@ -37,15 +37,15 @@ paths: schema: type: object required: - - wanted_trimmed_bytes + - evict_bytes properties: - wanted_trimmed_bytes: + evict_bytes: type: integer responses: "200": description: | The run completed. - This does not necessarily mean that we actually evicted `wanted_trimmed_bytes`. + This does not necessarily mean that we actually evicted `evict_bytes`. Examine the returned object for detail, or, just watch the actual effect of the call using `du` or `df`. content: application/json: diff --git a/pageserver/src/http/routes.rs b/pageserver/src/http/routes.rs index cad9a2efaf..be2d785c53 100644 --- a/pageserver/src/http/routes.rs +++ b/pageserver/src/http/routes.rs @@ -1205,19 +1205,19 @@ async fn disk_usage_eviction_run(mut r: Request) -> Result, #[derive(serde::Deserialize)] struct Config { - /// How much to trim at minimum - wanted_trimmed_bytes: u64, + /// How many bytes to evict before reporting that pressure is relieved. + evict_bytes: u64, } #[derive(Debug, Clone, Copy, serde::Serialize)] struct Usage { - wanted_trimmed_bytes: u64, + evict_bytes: u64, freed_bytes: u64, } impl crate::disk_usage_eviction_task::Usage for Usage { fn has_pressure(&self) -> bool { - self.wanted_trimmed_bytes > self.freed_bytes + self.evict_bytes > self.freed_bytes } fn add_available_bytes(&mut self, bytes: u64) { @@ -1230,7 +1230,7 @@ async fn disk_usage_eviction_run(mut r: Request) -> Result, .map_err(|_| ApiError::BadRequest(anyhow::anyhow!("invalid JSON body")))?; let usage = Usage { - wanted_trimmed_bytes: config.wanted_trimmed_bytes, + evict_bytes: config.evict_bytes, freed_bytes: 0, }; diff --git a/test_runner/regress/test_disk_usage_eviction.py b/test_runner/regress/test_disk_usage_eviction.py index 68efbd217b..de3892421c 100644 --- a/test_runner/regress/test_disk_usage_eviction.py +++ b/test_runner/regress/test_disk_usage_eviction.py @@ -166,7 +166,7 @@ def test_pageserver_evicts_until_pressure_is_relieved(eviction_env: EvictionEnv) target = total_on_disk // 2 - response = pageserver_http.disk_usage_eviction_run({"wanted_trimmed_bytes": target}) + response = pageserver_http.disk_usage_eviction_run({"evict_bytes": target}) log.info(f"{response}") (later_total_on_disk, _, _) = env.timelines_du() @@ -211,7 +211,7 @@ def test_pageserver_respects_overridden_resident_size(eviction_env: EvictionEnv) ps_http.set_tenant_config(large_tenant[0], {"min_resident_size_override": min_resident_size}) # do one run - response = ps_http.disk_usage_eviction_run({"wanted_trimmed_bytes": target}) + response = ps_http.disk_usage_eviction_run({"evict_bytes": target}) log.info(f"{response}") time.sleep(1) # give log time to flush @@ -251,7 +251,7 @@ def test_pageserver_falls_back_to_global_lru(eviction_env: EvictionEnv): (total_on_disk, _, _) = env.timelines_du() target = total_on_disk - response = ps_http.disk_usage_eviction_run({"wanted_trimmed_bytes": target}) + response = ps_http.disk_usage_eviction_run({"evict_bytes": target}) log.info(f"{response}") (later_total_on_disk, _, _) = env.timelines_du() @@ -281,7 +281,7 @@ def test_partial_evict_tenant(eviction_env: EvictionEnv): env.pg_bin.run(["pgbench", "-S" , pg.connstr()]) target = total_on_disk - (tenant_usage//2) - response = ps_http.disk_usage_eviction_run({"wanted_trimmed_bytes": target}) + response = ps_http.disk_usage_eviction_run({"evict_bytes": target}) log.info(f"{response}") (later_total_on_disk, _, _) = env.timelines_du()