cache: apply per-volume settings on first start after clear#13252
Open
masaori335 wants to merge 1 commit into
Open
cache: apply per-volume settings on first start after clear#13252masaori335 wants to merge 1 commit into
masaori335 wants to merge 1 commit into
Conversation
Per-volume tuning (ram_cache, ram_cache_size, ram_cache_cutoff, avg_obj_size, fragment_size) was only copied onto the CacheVol when matching an existing on-disk volume, so volumes created fresh (e.g. the first start after a cache clear) ignored the config until the next restart. Apply the settings in one pass after all CacheVols exist. Extend cache_volume_features to verify the settings take effect via per-volume metrics.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes cache initialization so that per-volume tuning from storage.yaml (e.g., ram_cache, ram_cache_size, ram_cache_cutoff, avg_obj_size, fragment_size) is applied even when cache volumes are created fresh (such as the first startup after a cache clear), rather than only taking effect after a subsequent restart.
Changes:
- Apply per-volume configuration settings in a dedicated pass after all
CacheVolinstances are created/linked duringcplist_reconfigure(). - Refactor the per-volume field-copying logic into a helper to keep
cplist_update()focused on linking volumes. - Extend the
cache_volume_featuresgold test to validate behavior via per-volume metrics on a fresh cache.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/iocore/cache/CacheProcessor.cc |
Applies per-volume config to CacheVol objects after creation/linking so fresh volumes don’t retain defaults until restart. |
tests/gold_tests/cache/cache_volume_features.replay.yaml |
Adds metric checks for per-volume RAM cache sizing and directory entry sizing to validate first-start behavior. |
tests/gold_tests/cache/cache_volume_features.test.py |
Updates the test summary to reflect the expanded coverage. |
Contributor
Author
|
[approve ci autest 1of4] |
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.
Per-volume tuning (ram_cache, ram_cache_size, ram_cache_cutoff, avg_obj_size, fragment_size) was only copied onto the CacheVol when matching an existing on-disk volume, so volumes created fresh (e.g. the first start after a cache clear) ignored the config until the next restart. Apply the settings in one pass after all CacheVols exist.
Extend cache_volume_features to verify the settings take effect via per-volume metrics.