You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR addresses issue #2132 by making RocksDB cache configurable per Column Family (CF), replacing the previous hardcoded cache values and cache_size_multiplier approach.
Changes Made
New Configuration System
Created RocksCfCacheConfig: A new configuration struct that allows individual cache size settings for each Column Family
Individual CF configurations: Each CF now has its own configurable cache size with appropriate defaults:
accounts: 10GB (optimized for frequent point lookups)
account_slots: 30GB (largest cache for high-volume slot storage)
accounts_history: 2GB
account_slots_history: 2GB
transactions: 2GB
blocks_by_number: 2GB
blocks_by_hash: 2GB
block_changes: 2GB
CLI and Environment Variable Support
Each CF cache size can be configured via:
Command line arguments (e.g., --rocks-cf-cache-accounts)
Consider using a configuration file or environment variables to set these cache sizes instead of hard-coding them. This would allow for easier tuning and adjustment of cache sizes without recompiling the code.
Why: The suggestion to use a configuration file or environment variables for cache sizes is valuable. It enhances flexibility and ease of tuning without code changes. However, it's not addressing a critical issue, hence the score of 7.
❌ Patch coverage is 68.62745% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.58%. Comparing base (57ec6ae) to head (47e786a). ⚠️ Report is 1 commits behind head on main.
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
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.
User description
Description
This PR addresses issue #2132 by making RocksDB cache configurable per Column Family (CF), replacing the previous hardcoded cache values and cache_size_multiplier approach.
Changes Made
New Configuration System
CLI and Environment Variable Support
Integration Points
Cleanup
Configuration Examples
Command line:
Environment variables:
Fixes #2132
PR Type
Enhancement, Configuration changes
Description
Introduced RocksCfCacheConfig for per-CF cache configuration
Replaced cache_size_multiplier with individual CF settings
Updated storage initialization to use new config
Removed obsolete ROCKS_CACHE_SIZE_MULTIPLIER configuration
Diagram Walkthrough
File Walkthrough
5 files
Introduce RocksCfCacheConfig struct for per-CF cache settingsUpdate generate_cf_options_map to use RocksCfCacheConfigUpdate RocksPermanentStorage to use RocksCfCacheConfigUpdate RocksStorageState initialization with RocksCfCacheConfigUpdate RocksStorageState initialization with RocksCfCacheConfig2 files
Replace rocks_cache_size_multiplier with rocks_cf_cache in configRemove obsolete ROCKS_CACHE_SIZE_MULTIPLIER configuration1 files
Update StratusStorage to use RocksCfCacheConfig in tests1 files