Skip to content

Commit

Permalink
fix(pageserver): handle version number in draw timeline (#8102)
Browse files Browse the repository at this point in the history
We now have a `vX` number in the file name, i.e.,
`000000067F0000000400000B150100000000-000000067F0000000400000D350100000000__00000000014B7AC8-v1-00000001`

The related pull request for new-style path was merged a month ago
#7660

## Summary of changes

Fixed the draw timeline dir command to handle it.

---------

Signed-off-by: Alex Chi Z <chi@neon.tech>
  • Loading branch information
skyzh authored and conradludgate committed Jun 27, 2024
1 parent cc5c663 commit 26401cb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pageserver/ctl/src/draw_timeline_dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,18 @@ fn parse_filename(name: &str) -> (Range<Key>, Range<Lsn>) {
let keys: Vec<&str> = split[0].split('-').collect();
let mut lsns: Vec<&str> = split[1].split('-').collect();

// The current format of the layer file name: 000000067F0000000400000B150100000000-000000067F0000000400000D350100000000__00000000014B7AC8-v1-00000001

// Handle generation number `-00000001` part
if lsns.last().expect("should").len() == 8 {
lsns.pop();
}

// Handle version number `-v1` part
if lsns.last().expect("should").starts_with('v') {
lsns.pop();
}

if lsns.len() == 1 {
lsns.push(lsns[0]);
}
Expand Down

0 comments on commit 26401cb

Please sign in to comment.