Remove temp layer files during timeline initialization on pageserver start

This commit is contained in:
Anastasia Lubennikova
2022-05-18 23:46:38 +03:00
parent 4c30ae8ba3
commit cbd00d7ed9

View File

@@ -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);
}