From 64a4fb35c93d3d59ff48e9b049f46da713b67fc0 Mon Sep 17 00:00:00 2001 From: John Spray Date: Mon, 7 Aug 2023 08:24:50 +0100 Subject: [PATCH] pagectl: skip `metadata` file in `pagectl draw-timeline` (#4872) ## Problem Running `pagectl draw-timeline` on a pageserver directory wasn't working out of the box because it trips up on the `metadata` file. ## Summary of changes Just ignore the `metadata` file in the list of input files passed to `draw-timeline`. --- pageserver/ctl/src/draw_timeline_dir.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pageserver/ctl/src/draw_timeline_dir.rs b/pageserver/ctl/src/draw_timeline_dir.rs index 568078808fc6..0e77ef056383 100644 --- a/pageserver/ctl/src/draw_timeline_dir.rs +++ b/pageserver/ctl/src/draw_timeline_dir.rs @@ -23,6 +23,7 @@ //! use anyhow::Result; use pageserver::repository::Key; +use pageserver::METADATA_FILE_NAME; use std::cmp::Ordering; use std::io::{self, BufRead}; use std::path::PathBuf; @@ -71,6 +72,10 @@ pub fn main() -> Result<()> { let line = PathBuf::from_str(&line).unwrap(); let filename = line.file_name().unwrap(); let filename = filename.to_str().unwrap(); + if filename == METADATA_FILE_NAME { + // Don't try and parse "metadata" like a key-lsn range + continue; + } let range = parse_filename(filename); ranges.push(range); }