From 328ec1ce2469ee964f81e2b9b87fc61c290a70cd Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Fri, 18 Nov 2022 10:18:42 +0200 Subject: [PATCH] Print a more full error message, with stack trace, on GC failure. In a CI run, I got a test failure because of this error in the log, from the test_get_tenant_size_with_multiple_branches test: ERROR gc_loop{tenant_id=f1630516d4b526139836ced93be0c878}: Gc failed, retrying in 2s: No such file or directory (os error 2) There are known race conditions between GC and timeline deletion, which surely caused that error. But if we didn't know the cause, it would be pretty hard to debug without a stack trace. --- pageserver/src/tenant_tasks.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pageserver/src/tenant_tasks.rs b/pageserver/src/tenant_tasks.rs index 5a9c5aa3a5..d8a4d5521c 100644 --- a/pageserver/src/tenant_tasks.rs +++ b/pageserver/src/tenant_tasks.rs @@ -71,7 +71,7 @@ async fn compaction_loop(tenant_id: TenantId) { let mut sleep_duration = tenant.get_compaction_period(); if let Err(e) = tenant.compaction_iteration() { sleep_duration = wait_duration; - error!("Compaction failed, retrying in {:?}: {e:#}", sleep_duration); + error!("Compaction failed, retrying in {:?}: {e:?}", sleep_duration); } // Sleep @@ -120,7 +120,7 @@ async fn gc_loop(tenant_id: TenantId) { if let Err(e) = tenant.gc_iteration(None, gc_horizon, tenant.get_pitr_interval(), false).await { sleep_duration = wait_duration; - error!("Gc failed, retrying in {:?}: {e:#}", sleep_duration); + error!("Gc failed, retrying in {:?}: {e:?}", sleep_duration); } }