-
Notifications
You must be signed in to change notification settings - Fork 9
Add payload-size-aware large-value zone eviction for EloqKV (ObjectCcMap) #415
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
Draft
Copilot
wants to merge
15
commits into
main
Choose a base branch
from
copilot/enhance-cache-eviction-policy
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
7773430
Initial plan
Copilot 0a352b4
Add payload-size-aware cache eviction policy
Copilot cd82128
Document access_counter_ semantics and last_access_ts_ invariants
Copilot 30ba06e
Changes before error encountered
Copilot 55925be
Replace absolute eviction-age threshold with self-calibrating relativ…
Copilot ebf1654
Replace broken relative-position check with LRU-boost eviction guard
Copilot 8ced98f
Replace LRU-boost with zone-separation for large-value eviction prote…
Copilot f0ab3b9
Add zone-ratio control analogous to SLRU protected-segment cap
Copilot 991a12f
Remove fixed-capacity zone-ratio control; keep zone-separation pointer
Copilot 42d757e
Replace lru_large_value_zone_head_ pointer with head_large_ccp_ dummy…
Copilot 741a80d
Revert dummy sentinel: restore pointer-based lru_large_value_zone_head_
Copilot af3e67a
Add eager re-zone via MaybeMarkAndRezoneAsLargeValue at all payload-s…
Copilot aaeb998
Remove accidentally committed _codeql_detected_source_root symlink
Copilot 5e5ab61
Scope large-value zone eviction policy to ObjectCcMap (EloqKV) only
Copilot 1b1380f
Move eager re-zone calls from TemplateCcMap to ObjectCcMap
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -358,3 +358,4 @@ compile_commands.json | |
|
|
||
| cmake-build-debug/ | ||
| .cache | ||
| _codeql_detected_source_root | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
这个算法存在两个问题:
shard.access_counter_是一个shard level的值,某个热点key就可以使它变得很大。用户不知道怎么配置txservice_large_value_eviction_age,也不想配置。
large value容易沉淀到LRU list的头部,但是因为它的age小于txservice_large_value_eviction_age,所以不会被踢掉。这造成了LRU 扫描的时候做了一些无效的工作,扫描了不能被踢的large value。
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.
Fixed in commit 55925be.
Both problems are resolved by replacing the absolute
txservice_large_value_eviction_agethreshold with a self-calibrating relative LRU-position check:Problem 1 (unconfigurable threshold):
txservice_large_value_eviction_ageis removed entirely. The check compares a page's age against the total span of the LRU list, so it self-calibrates regardless of how fastaccess_counter_grows. No user configuration is needed.Problem 2 (cold large values blocking the scan): A cold large-value page near the LRU head has
page_age ≈ total_span, sopage_age * 2 >= total_span— it is immediately eligible for eviction rather than wasting scan work.