Skip to content

cache: apply per-volume settings on first start after clear#13252

Open
masaori335 wants to merge 1 commit into
apache:masterfrom
masaori335:asf-master-autest-volume
Open

cache: apply per-volume settings on first start after clear#13252
masaori335 wants to merge 1 commit into
apache:masterfrom
masaori335:asf-master-autest-volume

Conversation

@masaori335

Copy link
Copy Markdown
Contributor

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.

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.
@masaori335 masaori335 added this to the 11.0.0 milestone Jun 10, 2026
@masaori335 masaori335 self-assigned this Jun 10, 2026
Copilot AI review requested due to automatic review settings June 10, 2026 04:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 CacheVol instances are created/linked during cplist_reconfigure().
  • Refactor the per-volume field-copying logic into a helper to keep cplist_update() focused on linking volumes.
  • Extend the cache_volume_features gold 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.

@masaori335

Copy link
Copy Markdown
Contributor Author

[approve ci autest 1of4]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants