-
Notifications
You must be signed in to change notification settings - Fork 719
ct: evict from batch cache during reconciliation
#29598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ece84d0
9c3b7ef
8bdd877
a4cb72a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -94,6 +94,11 @@ class data_plane_api { | |||||||||||||||
| /// Retrieve materialized record batch from cache | ||||||||||||||||
| virtual std::optional<model::record_batch> | ||||||||||||||||
| cache_get(const model::topic_id_partition&, model::offset o) = 0; | ||||||||||||||||
|
|
||||||||||||||||
| /// Evict cached entries with base_offset <= up_to | ||||||||||||||||
|
||||||||||||||||
| /// Evict cached entries with base_offset <= up_to | |
| /// Evict cached entries whose base_offset is less than or equal to | |
| /// `up_to`. Implementations typically evict at range granularity, and | |
| /// multiple batches may share the same cached range. As a result, this | |
| /// call may also evict entries with base_offset > `up_to` that fall into | |
| /// an evicted range; callers must not rely on such entries remaining | |
| /// cached after this call. |
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -597,6 +597,11 @@ class batch_cache_index { | |||||||||||||||
| */ | ||||||||||||||||
| void truncate(model::offset offset); | ||||||||||||||||
|
|
||||||||||||||||
| /** | ||||||||||||||||
| * Evicts all entries with base_offset <= the given offset. | ||||||||||||||||
|
||||||||||||||||
| * Evicts all entries with base_offset <= the given offset. | |
| * Evicts all cache entries whose base offset is less than or equal to the | |
| * given offset. Eviction is performed on underlying cache ranges rather | |
| * than individual batches, so when multiple batches share a cache range | |
| * (for example due to small-batch coalescing), this may also evict some | |
| * batches with base_offset > offset. Callers must not rely on precise | |
| * per-entry eviction semantics. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
batch_cache::evict_up_tois documented as evicting entries withbase_offset <= o, but under the hood it delegates tostorage::batch_cache_index::evict_up_to, which evicts whole ranges. If multiple batches were coalesced into the same range, this can evict additional batches withbase_offset > o. Please adjust the comment to reflect the range-granularity behavior so callers have an accurate contract.