Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pageserver/compaction/src/compact_tiered.rs
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ impl<K: CompactionKey> KeyspaceWindowPos<K> {
self.accum_keysize += distance as u64;
} else {
// advance within the range
let skip_key = self.end_key.skip_some();
let skip_key = self.end_key.add(128);
let distance = K::key_range_size(&(self.end_key..skip_key), shard_identity);
if (self.accum_keysize + distance as u64) < max_size {
self.end_key = skip_key;
Expand Down
10 changes: 4 additions & 6 deletions pageserver/compaction/src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,8 @@ pub trait CompactionKey: std::cmp::Ord + Clone + Copy + std::fmt::Display {
// return "self + 1"
fn next(&self) -> Self;

// return "self + <some decent amount to skip>". The amount to skip
// is left to the implementation.
// FIXME: why not just "add(u32)" ? This is hard to use
fn skip_some(&self) -> Self;
// return "self + offset"
fn add(&self, offset: u32) -> Self;
}

impl CompactionKey for Key {
Expand All @@ -125,8 +123,8 @@ impl CompactionKey for Key {
fn next(&self) -> Key {
(self as &Key).next()
}
fn skip_some(&self) -> Key {
self.add(128)
fn add(&self, offset: u32) -> Key {
(self as &Key).add(offset)
}
}

Expand Down
5 changes: 2 additions & 3 deletions pageserver/compaction/src/simulator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,8 @@ impl interface::CompactionKey for Key {
fn next(&self) -> Self {
self + 1
}
fn skip_some(&self) -> Self {
// round up to next xx
self + 100
fn add(&self, offset: u32) -> Self {
self + offset as u64
}
}

Expand Down