Skip to content

revert(cache): remove opt-in remote-origin prewarm from #1510 - #1522

Merged
alpergundogdu merged 1 commit into
mainfrom
claude/delete-prewarm-pr-838e07
Jul 30, 2026
Merged

alpergundogdu merged 1 commit into
mainfrom
claude/delete-prewarm-pr-838e07

Conversation

@alpergundogdu

@alpergundogdu alpergundogdu commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Removes the cache.prewarm feature that landed as item #1 of #1510, while leaving that PR's four other changes intact — the #1470 Candidate.stake: u64 change, the #1475 metric sibling-counter convention docs, and the #1504/#1508 watcher-drift fixes.

What prewarm was

An opt-in flag that, on http/s3 origins, pulled cache.pinned_hashes into the store at startup and on decdn node reload so the first request for pinned content didn't pay full pull-through latency. It never shipped in a tagged release.

Removed

  • Engine — CacheEngine::prewarm / prewarm_cancellable / prewarm_pinned and the PrewarmReport / PrewarmOutcome / FillOwnership types. populate_inner reverts to CacheResult<()>; the FillOwnership metering existed solely to give prewarm a coalesced-vs-fetched distinction, so populate / populate_local return to plain ().
  • Metrics — the four decdn_cache_prewarm_{blobs,bytes,refused,failures}_total counters and their observability-appendix rows.
  • Config — the cache.prewarm field, DEFAULT_PREWARM, prewarm_enabled_for, and the decdn config validate / config init template reporting of the flag.
  • Runtime — the startup prewarm task, the shutdown-time cancellation, and the reload-time single-flight warm machinery (warm_in_flight / warm_dirty / warm_wanted / prewarm_stop). The reload path reverts to a plain detached rescan_origins spawn.
  • Tests/docs — the crates/cache/tests/prewarm.rs integration suite, all prewarm unit tests, and the CHANGELOG entry.

Kept (deliberately)

Verification

  • cargo build, cargo clippy --all-targets, cargo fmt -- --check — clean.
  • cargo nextest run — decdn-cache/common/cli 1096 passed, decdn-node 897 passed.
  • cargo test --no-run -p decdn-e2e --features anvil-e2e — compiles.
  • RUSTDOCFLAGS="-D warnings" cargo doc --no-deps — clean for cache/common/node.
  • No contract change; Solidity jobs untouched.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Removed Features

    • Removed remote cache prewarming for pinned content during startup and reload.
    • Removed the cache.prewarm configuration option; configurations using it are no longer accepted.
    • Removed prewarming-related cache metrics and documentation.
  • Bug Fixes

    • Cache validation now reports disabled filesystem rescans clearly when configured with a zero interval.
    • Startup and reload warnings remain available when pinned content exceeds the configured cache size.

PR #1510 bundled five changes; this removes only the `cache.prewarm`
feature (its item #1) and leaves the other four intact — the #1470
`Candidate.stake: u64` change, the #1475 metric sibling-counter
convention docs, and the #1504/#1508 watcher-drift fixes.

Removed:
- `CacheEngine::prewarm` / `prewarm_cancellable` / `prewarm_pinned` and
  the `PrewarmReport` / `PrewarmOutcome` / `FillOwnership` types.
  `populate_inner` reverts to `CacheResult<()>` (the `FillOwnership`
  metering existed only to feed prewarm's coalesced-vs-fetched counts).
- The four `decdn_cache_prewarm_*` counters.
- `cache.prewarm` config field, `DEFAULT_PREWARM`, `prewarm_enabled_for`,
  and the `decdn config validate` / template reporting of the flag.
- Startup prewarm spawn, shutdown cancellation, and the reload-time
  single-flight warm machinery (`warm_in_flight` / `warm_dirty` /
  `warm_wanted` / `prewarm_stop`).
- The prewarm integration-test file and all prewarm unit tests, plus the
  observability-appendix rows and CHANGELOG entry.

Kept (per request): the oversized-pin-set warning
(`warn_if_pins_exceed_cache`), which is independent of prewarm — it runs
unconditionally at startup and on reload. The reload path reverts to a
plain detached `rescan_origins` + budget-warn spawn. The
`fs_rescan_interval_sec` `config validate` reporting (a #1508 drift fix)
is also kept.

Verification: cargo build, clippy --all-targets, fmt --check clean;
cache/common/cli 1096 tests and node 897 tests pass; anvil-e2e compile
gate and RUSTDOCFLAGS=-D warnings doc clean.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@coderabbitai

coderabbitai Bot commented Jul 30, 2026 •

Copy link
Copy Markdown

Review Change Stack

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Free

Run ID: 95f286dd-f76b-48ba-8339-33154961a0d7

📥 Commits

Reviewing files that changed from the base of the PR and between 00139cc and 1f1f8c6.

📒 Files selected for processing (16)
  • CHANGELOG.md
  • adr/appendix-observability.md
  • crates/cache/src/engine.rs
  • crates/cache/src/lib.rs
  • crates/cache/src/metrics.rs
  • crates/cache/tests/prewarm.rs
  • crates/cli/src/commands/config.rs
  • crates/cli/tests/config_validate.rs
  • crates/common/src/config/mod.rs
  • crates/common/src/config/resolved.rs
  • crates/common/src/config/types.rs
  • crates/node/src/metrics.rs
  • crates/node/src/runtime/mod.rs
  • crates/node/src/runtime/reload.rs
  • crates/node/tests/anvil_bringup_shutdown_e2e.rs
  • crates/node/tests/sighup_signal.rs
💤 Files with no reviewable changes (10)
  • crates/cache/src/metrics.rs
  • crates/common/src/config/resolved.rs
  • crates/cache/tests/prewarm.rs
  • crates/node/tests/sighup_signal.rs
  • adr/appendix-observability.md
  • crates/common/src/config/mod.rs
  • crates/node/tests/anvil_bringup_shutdown_e2e.rs
  • crates/cli/src/commands/config.rs
  • crates/common/src/config/types.rs
  • crates/node/src/metrics.rs

Walkthrough

Changes

Cache prewarming removal

Layer / File(s) Summary
Remove prewarm configuration and CLI reporting
crates/common/src/config/*, crates/cli/src/commands/config.rs, crates/cli/tests/config_validate.rs, CHANGELOG.md
The cache configuration and resolved types no longer contain prewarm; validation output and generated configuration documentation now describe only fs_rescan_interval_sec.
Remove prewarm engine APIs and metrics
crates/cache/src/engine.rs, crates/cache/src/lib.rs, crates/cache/src/metrics.rs, crates/cache/tests/prewarm.rs, crates/node/src/metrics.rs, adr/appendix-observability.md
Prewarm methods, reports, cancellation support, counters, integration tests, and metric documentation are removed; populate coalescing now returns CacheResult<()>.
Simplify startup and reload lifecycle
crates/node/src/runtime/*, crates/node/tests/*
Startup, reload, and shutdown no longer manage prewarm tasks or cancellation tokens; origin rescans and pinned-size warnings remain, with related fixtures and tests updated.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Runtime
  participant CacheEngine
  participant PinWarning
  Runtime->>PinWarning: check pinned size at startup
  Runtime->>CacheEngine: rescan_origins() on reload
  CacheEngine-->>Runtime: rescan result
  Runtime->>PinWarning: check pinned size after reload
Loading

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

Coverage report

Total: 80.11% (was 80.17%, ▼ 0.06%) — 53910/67291 lines

File Coverage Lines Δ
crates/cache/src/engine.rs 90.86% 2804/3086 ▼ 0.11%
crates/cache/src/lib.rs 100.00% 28/28 ● 0.00%
crates/cli/src/commands/config.rs 74.92% 233/311 ▼ 0.55%
crates/common/src/config/mod.rs 97.04% 6830/7038 ▼ 0.01%
crates/common/src/config/resolved.rs 100.00% 33/33 ● 0.00%
crates/node/src/metrics.rs 95.36% 965/1012 ▼ 0.03%
crates/node/src/runtime/mod.rs 46.24% 1083/2342 ▼ 0.11%
crates/node/src/runtime/reload.rs 96.37% 1644/1706 ▲ +0.24%
History
Commit Total Δ vs base
1f1f8c6 (HEAD) 80.11% ▼ 0.06%

@alpergundogdu
alpergundogdu merged commit e6c4cc3 into main Jul 30, 2026
25 checks passed
@alpergundogdu
alpergundogdu deleted the claude/delete-prewarm-pr-838e07 branch July 30, 2026 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant