mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-10 15:02:56 +00:00
fix(pageserver): don't panic if gc-compaction find no keys (#11200)
## Problem There was a panic on staging that compaction didn't find any keys. This is possible if all layers selected for compaction does not contain any keys within the current shard. ## Summary of changes Make panic an error. In the future, we can try creating an empty image layer so that GC can clean up those layers. Otherwise, for now, we can only rely on shard ancestor compaction to remove these data. Signed-off-by: Alex Chi Z <chi@neon.tech>
This commit is contained in:
@@ -3189,7 +3189,11 @@ impl Timeline {
|
||||
}
|
||||
|
||||
// TODO: move the below part to the loop body
|
||||
let last_key = last_key.expect("no keys produced during compaction");
|
||||
let Some(last_key) = last_key else {
|
||||
return Err(CompactionError::Other(anyhow!(
|
||||
"no keys produced during compaction"
|
||||
)));
|
||||
};
|
||||
stat.on_unique_key_visited();
|
||||
|
||||
let retention = self
|
||||
|
||||
Reference in New Issue
Block a user