mirror of
https://github.com/neondatabase/neon.git
synced 2026-07-05 13:10:37 +00:00
tenant shutdown: add some debug logging
This proved useful while debugging
https://github.com/neondatabase/neon/pull/4451#issuecomment-1584503248
resulting in
d4a86a415b
This commit is contained in:
@@ -1926,6 +1926,8 @@ impl Tenant {
|
||||
/// This will attempt to shutdown even if tenant is broken.
|
||||
pub(crate) async fn shutdown(&self, freeze_and_flush: bool) -> Result<(), ShutdownError> {
|
||||
debug_assert_current_span_has_tenant_id();
|
||||
debug!("start");
|
||||
|
||||
// Set tenant (and its timlines) to Stoppping state.
|
||||
//
|
||||
// Since we can only transition into Stopping state after activation is complete,
|
||||
@@ -1972,6 +1974,7 @@ impl Tenant {
|
||||
// this will additionally shutdown and await all timeline tasks.
|
||||
task_mgr::shutdown_tasks(None, Some(self.tenant_id), None).await;
|
||||
|
||||
debug!("complete");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
@@ -684,8 +684,11 @@ impl Timeline {
|
||||
/// Flush to disk all data that was written with the put_* functions
|
||||
#[instrument(skip(self), fields(tenant_id=%self.tenant_id, timeline_id=%self.timeline_id))]
|
||||
pub async fn freeze_and_flush(&self) -> anyhow::Result<()> {
|
||||
debug!("start");
|
||||
self.freeze_inmem_layer(false);
|
||||
self.flush_frozen_layers_and_wait().await
|
||||
let ret = self.flush_frozen_layers_and_wait().await;
|
||||
debug!(is_err = ret.is_err(), "complete");
|
||||
ret
|
||||
}
|
||||
|
||||
/// Outermost timeline compaction operation; downloads needed layers.
|
||||
|
||||
Reference in New Issue
Block a user