Skip to content

Conversation

A-Shalchian
Copy link

Summary

Refactors the CompactionKey trait to replace skip_some() with add(u32), addressing the FIXME comment in
pageserver/compaction/src/interface.rs:114.

Changes

  • interface.rs: Replace skip_some() method with add(offset: u32) in CompactionKey trait
  • simulator.rs: Update mock implementation to use new add() method
  • compact_tiered.rs: Update call site to explicitly use add(128)

Motivation

The previous skip_some() method was inflexible - it advanced by a hardcoded amount that implementors couldn't
control. The FIXME comment noted "why not just add(u32)? This is hard to use."

This change makes the API more flexible by allowing callers to specify exactly how much to advance, making the
intent clearer at call sites.

…on for key additionChanges:

  - Replace CompactionKey::skip_some() with add(offset: u32)
  - Update Key implementation to use new add() method
  - Update simulator mock implementation
  - Update call site in compact_tiered.rs to explicitly pass 128
@A-Shalchian A-Shalchian requested a review from a team as a code owner October 14, 2025 17:55
@A-Shalchian A-Shalchian requested a review from arpad-m October 14, 2025 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant