← Back to Pull requests

feat(cache): bind a CacheRuntime to a snapshot of its CacheRuntimeClass #6242

Open
unknown opened this pull request with 315 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 12, 2026 14:03 UTC
Author

Depends on #6177. The diff includes its commits; review only the last four commits (53afbac1, 64b0bd54, 7512a039, 5ac1064b). This branch will be rebased onto master after #6177 merges.

Ⅰ. Describe what this PR does

Editing a CacheRuntimeClass can currently change existing CacheRuntimes on their next reconcile. This PR binds each runtime to an immutable snapshot at its first Setup, so later class edits or deletion leave existing runtimes unchanged.

The snapshot covers the whole class, including component templates, options and data operation definitions, to keep images, configuration and scripts on the same version. It is stored in fluid-runtime-class-snapshot-<runtime>, a ConfigMap owned by the CacheRuntime.

  • Resources use the snapshot template as the baseline, with the per-key runtime overrides from #6177.

  • Runtime reconciliation and data operations use the same snapshot. Data operations wait for it rather than falling back to the live class.

  • Changing runtimeClassName keeps the existing binding and emits a warning. Recreate the CacheRuntime to use a different class version.

  • Invalid snapshots are reported and left untouched. Snapshot creation and cleanup handle informer cache lag and use UID preconditions when deleting a stale snapshot.
  • Also avoids workload updates caused only by reordered resource claims, and updates the English and Chinese guides for snapshot behavior and Pod updates.

    Ⅱ. Does this pull request fix one issue?

    Fixes #6213.

    Ⅲ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.

    Unit tests cover snapshot creation and ownership, class edits and deletion, invalid snapshots, cache lag, safe cleanup, read-only data operations, and resource claim ordering.

    The curvine e2e adds a check that class resource edits do not reach an existing worker, while a runtime replica change still takes effect.

    Ⅳ. Describe how to verify it

    go test -gcflags=all=-l ./pkg/ddc/cache/... ./pkg/common/...
    

    On a cluster, create a CacheRuntime, edit its class resources, and trigger a reconcile. The worker resources should stay unchanged. Updating the CacheRuntime's own resource overrides should still apply.

    Ⅴ. Special notes for reviews

    CacheRuntime has not been released; migration from earlier development builds is not included. Unlike the original #6213 sketch, this snapshots the whole class, following #6239.

    The curvine e2e was syntax-checked locally, but was not run on kind.

    Diff: 315 lines (+236 / -79) across 3 files Reviewer: cheyang Review duration: 2418m
    All Vouch review confidence checks passed
    Residual risk 0.22 = Change Risk (0.40) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 315 lines diff across 3 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.344
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #6242"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 40.4% (MEDIUM) · Higher = larger blast radius
    40.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 21.5% · Safe to merge
    21.5%