Fix wal-redo unwrap() failure for timeline chains that have 0 records in some timeline

This commit is contained in:
Anastasia Lubennikova
2024-09-13 03:31:54 +01:00
parent 11e77815af
commit 168a6a87d7

View File

@@ -5206,10 +5206,18 @@ impl Timeline {
.cloned()
.collect::<Vec<_>>();
records = &records[scratch.len()..];
if later.is_none() {
assert!(records.is_empty());
}
// if we don't have any records for this timeline (which is possible)
// go to the previous one
if scratch.is_empty() {
tracing::info!("no records for timeline {}", older.timeline_id);
continue;
}
// this is only used for logging on the next round
let last_lsn = scratch.last().unwrap().0;