feat(umbp): pluggable master eviction strategy#399
Merged
Conversation
Extract the hard-coded LRU into Route{Put,Get}-style strategy interfaces on the
master (MasterEvictStrategy) and SSD (SsdEvictStrategy) tiers, each defaulting
to LRU. Behavior unchanged; no env knobs.
Revert the SSD SsdEvictStrategy seam: a selector-only seam is a recency-only pseudo-plugin, so SSD keeps its inline LRU with a note on the target design. Master-side MasterEvictStrategy is unchanged.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
MasterEvictStrategyinterface, mirroring the existing Route{Put,Get} strategy pattern.EvictionManagerkeeps watermark detection, candidate gathering, andEvictKeydispatch; the strategy only ranks candidates and picks victims within the per-(node,tier) byte budget. Default isLruMasterEvictStrategy(behavior unchanged), injected viaMasterServerConfig::evict_strategy; no env knobs.PeerSsdManager. A selector-only seam there would be a recency-only pseudo-plugin, since the per-algorithm state (recency/frequency/prefix) lives with the manager. A code comment records the target design (a stateful policy withOnAdd/OnTouch/OnRemove/Clearhooks +SelectVictimsunder the lock) for when a second SSD policy is actually needed.The two commits are kept separate on purpose: the first adds the full master+SSD seam; the second walks the SSD seam back to master-only.
Test plan
test_umbp_master_evict_strategy(default LRU behavior) passestest_peer_ssd_eviction,test_peer_ssd_manager,test_global_block_index_events,test_umbp_route_put_strategypassumbp_common/umbp_masterbuild clean in theyutong-umbpcontainer