From e839c971884fd15025326476cf99181941c9af4d Mon Sep 17 00:00:00 2001 From: Dmitry Rodionov Date: Fri, 9 Jun 2023 22:10:37 +0300 Subject: [PATCH] fix uninit glitch cherry-picked from https://github.com/neondatabase/neon/pull/4458 --- pageserver/src/tenant.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pageserver/src/tenant.rs b/pageserver/src/tenant.rs index 1ca1be7a64..f318090712 100644 --- a/pageserver/src/tenant.rs +++ b/pageserver/src/tenant.rs @@ -1054,6 +1054,13 @@ impl Tenant { ); } } else if is_uninit_mark(&timeline_dir) { + if !timeline_dir.exists() { + warn!( + "Timeline dir entry become invalid: {}", + timeline_dir.display() + ); + continue; + } let timeline_uninit_mark_file = &timeline_dir; info!( "Found an uninit mark file {}, removing the timeline and its uninit mark", @@ -1077,6 +1084,13 @@ impl Tenant { error!("Failed to clean up uninit marked timeline: {e:?}"); } } else { + if !timeline_dir.exists() { + warn!( + "Timeline dir entry become invalid: {}", + timeline_dir.display() + ); + continue; + } let timeline_id = timeline_dir .file_name() .and_then(OsStr::to_str)