-
Notifications
You must be signed in to change notification settings - Fork 9
Support optional large object LRU policy #426
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
base: main
Are you sure you want to change the base?
Changes from all commits
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 |
|---|---|---|
|
|
@@ -1813,6 +1813,18 @@ class LocalCcShards | |
|
|
||
| void FlushCurrentFlushBuffer(); | ||
|
|
||
| void SetupPolicyLRU() | ||
| { | ||
| cache_evict_policy_ = CacheEvictPolicy::LRU; | ||
| } | ||
|
|
||
| void SetupPolicyLoLRU(uint32_t large_obj_threshold_kb) | ||
| { | ||
| cache_evict_policy_ = CacheEvictPolicy::LO_LRU; | ||
| u_cache_evict_policy_.lo_lru.large_obj_threshold_bytes = | ||
| large_obj_threshold_kb * 1024ull; | ||
| } | ||
|
Comment on lines
+1816
to
+1826
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make policy switches synchronized or init-only.
Also applies to: 2060-2065 🤖 Prompt for AI Agents |
||
|
|
||
| store::DataStoreHandler *const store_hd_; | ||
|
|
||
| /* | ||
|
|
@@ -2045,6 +2057,13 @@ class LocalCcShards | |
|
|
||
| bool realtime_sampling_; | ||
|
|
||
| CacheEvictPolicy cache_evict_policy_{CacheEvictPolicy::LRU}; | ||
| union | ||
| { | ||
| CacheEvictPolicyLRU lru; | ||
| CacheEvictPolicyLoLRU lo_lru; | ||
| } u_cache_evict_policy_; | ||
|
|
||
| struct RangeSplitTask | ||
| { | ||
| RangeSplitTask(std::shared_ptr<DataSyncTask> data_sync_task, | ||
|
|
||
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.
Handle tombstones and null payloads when updating
smallest_ttl_.Line 2303 and Line 2588 dereference
cur_payload_unconditionally, but deleted entries are represented with a null payload. The full recompute path also never applies the documented deleted-entry sentinel (smallest_ttl_ = 0), so after re-homing a page with tombstones can either crash here or be skipped by purge logic.Proposed fix
Also applies to: 2581-2597
🤖 Prompt for AI Agents