From 72a7220dc8c7a247ea411f3e381c8710f99617b7 Mon Sep 17 00:00:00 2001 From: Dmitry Rodionov Date: Thu, 26 May 2022 16:48:32 +0300 Subject: [PATCH] Tidy up some log messages * turn println into an info with proper message * rename new_local_timeline to load_local_timeline because it does not create new timeline, it registers timeline that exists on disk in pageserver in-memory structures --- pageserver/src/tenant_mgr.rs | 10 +++++----- pageserver/src/timelines.rs | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pageserver/src/tenant_mgr.rs b/pageserver/src/tenant_mgr.rs index bbe66d7f80..bba67394c3 100644 --- a/pageserver/src/tenant_mgr.rs +++ b/pageserver/src/tenant_mgr.rs @@ -327,8 +327,8 @@ pub fn get_local_timeline_with_load( return Ok(Arc::clone(page_tline)); } - let page_tline = new_local_timeline(&tenant.repo, timeline_id) - .with_context(|| format!("Failed to create new local timeline for tenant {tenant_id}"))?; + let page_tline = load_local_timeline(&tenant.repo, timeline_id) + .with_context(|| format!("Failed to load local timeline for tenant {tenant_id}"))?; tenant .local_timelines .insert(timeline_id, Arc::clone(&page_tline)); @@ -365,7 +365,7 @@ pub fn detach_timeline( Ok(()) } -fn new_local_timeline( +fn load_local_timeline( repo: &RepositoryImpl, timeline_id: ZTimelineId, ) -> anyhow::Result>> { @@ -458,8 +458,8 @@ fn apply_timeline_remote_sync_status_updates( bail!("Local timeline {timeline_id} already registered") } Entry::Vacant(v) => { - v.insert(new_local_timeline(repo, timeline_id).with_context(|| { - format!("Failed to register new local timeline for tenant {tenant_id}") + v.insert(load_local_timeline(repo, timeline_id).with_context(|| { + format!("Failed to register add local timeline for tenant {tenant_id}") })?); } }, diff --git a/pageserver/src/timelines.rs b/pageserver/src/timelines.rs index eadf5bf4e0..408eca6501 100644 --- a/pageserver/src/timelines.rs +++ b/pageserver/src/timelines.rs @@ -302,8 +302,8 @@ fn bootstrap_timeline( import_datadir::import_timeline_from_postgres_datadir(&pgdata_path, &mut page_tline, lsn)?; page_tline.tline.checkpoint(CheckpointConfig::Forced)?; - println!( - "created initial timeline {} timeline.lsn {}", + info!( + "created root timeline {} timeline.lsn {}", tli, page_tline.tline.get_last_record_lsn() );