diff --git a/pageserver/src/storage_sync.rs b/pageserver/src/storage_sync.rs index 39459fafc6..bbebcd1f36 100644 --- a/pageserver/src/storage_sync.rs +++ b/pageserver/src/storage_sync.rs @@ -421,6 +421,14 @@ fn collect_timeline_files( entry_path.display() ) })?; + } else if entry_path.extension().and_then(OsStr::to_str) == Some("temp") { + info!("removing temp layer file at {}", entry_path.display()); + std::fs::remove_file(&entry_path).with_context(|| { + format!( + "failed to remove temp layer file at {}", + entry_path.display() + ) + })?; } else { timeline_files.insert(entry_path); }