mirror of
https://github.com/neondatabase/neon.git
synced 2026-10-19 18:23:08 +00:00
refactors
This commit is contained in:
@@ -480,14 +480,11 @@ impl Drop for LayerInner {
|
||||
|
||||
// We will only do I/O on drop if our Timeline still exists. Otherwise, we may safely
|
||||
// leave garbage layers behind to be cleaned up the next time this Timeline is instantiated.
|
||||
let timeline = match self.timeline.upgrade() {
|
||||
Some(t) => t,
|
||||
None => {
|
||||
// no need to nag that timeline is gone: under normal situation on
|
||||
// task_mgr::remove_tenant_from_memory the timeline is gone before we get dropped.
|
||||
LAYER_IMPL_METRICS.inc_deletes_failed(DeleteFailed::TimelineGone);
|
||||
return;
|
||||
}
|
||||
let Some(timeline) = self.timeline.upgrade() else {
|
||||
// no need to nag that timeline is gone: under normal situation on
|
||||
// task_mgr::remove_tenant_from_memory the timeline is gone before we get dropped.
|
||||
LAYER_IMPL_METRICS.inc_deletes_failed(DeleteFailed::TimelineGone);
|
||||
return;
|
||||
};
|
||||
|
||||
// We will only do I/O during drop if our Timeline's layer_gate is open: this avoids
|
||||
|
||||
@@ -34,7 +34,7 @@ impl LayerManager {
|
||||
}
|
||||
|
||||
pub(crate) fn clear(&mut self) {
|
||||
std::mem::take(&mut self.layer_map);
|
||||
self.layer_map = LayerMap::default();
|
||||
self.layer_fmgr.clear();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user