Skip to content

Decode warm-pool config hashes as stored instead of forcing sha256 - #896

Merged
kumarpallav-pplx merged 1 commit into
mainfrom
kumarpallav-pplx/warm-pool-blake3-content-hash
Oct 23, 2026
Merged

kumarpallav-pplx merged 1 commit into
mainfrom
kumarpallav-pplx/warm-pool-blake3-content-hash

Conversation

@kumarpallav-pplx

Copy link
Copy Markdown
Collaborator

Problem

The warm-pool config reads in crates/libs/cluster/pool/src/store.rs normalized the release hash in SQL:

CASE WHEN r.hash LIKE 'sha256:%' THEN r.hash ELSE 'sha256:' || r.hash END AS content_hash

Template-manager now registers BLAKE3 template identities by default, so a blake3:<hex> release is rewritten to sha256:blake3:<hex>. That fails to parse as a ContentHash (digest for sha256 must have 64 lowercase hex chars, got 71). The rows are collected into one Result, so a single BLAKE3 release on any pool config fails the whole warm-pool reconcile pass. No template gets refill, promotion, or cleanup, and pools for BLAKE3 releases never get slots.

Fix

Select template_releases.hash as stored and let ContentHash::from_str decode it. It already accepts bare sha256 hex, sha256:-prefixed, and blake3:-prefixed values, so bare legacy rows keep working. The change applies to the four config reads that shared the rewrite:

  • enabled_configs
  • reconcilable_configs
  • recently_disabled_configs
  • delete_empty_disabled_autoscale_configs, reached through autoscale_configs, the first read of each pass

observed_demand keeps its bare/prefixed matching. Its first arm, r.hash = s.content_hash, already matches BLAKE3 hashes exactly.

Tests

  • New test config_reads_decode_blake3_release_hashes seeds a pool config on a blake3: release and asserts that all four reads decode it unchanged.
    • Before the fix: Error: ContentHash(InvalidHexLength { algorithm: Sha256, expected: 64, actual: 71 }), the same error the controller logs.
    • After the fix: the test passes.
  • cargo test -p pplx-space-cluster-pool --lib: 68 passed, including the existing bare and prefixed sha256 hash tests.
  • cargo test -p pplx-space-cluster-controller-server --lib warm_pool: 69 passed.
  • cargo fmt --all -- --check and cargo clippy -p pplx-space-cluster-pool -p pplx-space-cluster-controller-server --locked --all-features --all-targets -- -D warnings are clean.
  • I have not run the full workspace suite locally; CI runs it.

Rollout note

Clusters that have already registered BLAKE3 releases on pool configs recover on the first reconcile pass after the cluster-controller picks this up. No data change is needed.

The warm-pool config reads rewrote every release hash without a `sha256:`
prefix into `sha256:<hash>`. Template-manager now registers BLAKE3
identities by default, so a `blake3:<hex>` release became
`sha256:blake3:<hex>` and failed to parse. Because the rows are collected
into one Result, a single BLAKE3 release on any pool config failed the
whole reconcile pass: no refill, promotion, or cleanup for any template.

Select `template_releases.hash` as stored and let `ContentHash::from_str`
decode it; it already accepts bare sha256, `sha256:`, and `blake3:` forms.
Covers enabled, reconcilable, recently-disabled, and autoscaler-retirement
config reads.
@kumarpallav-pplx
kumarpallav-pplx marked this pull request as ready for review October 23, 2026 04:05
@kumarpallav-pplx
kumarpallav-pplx added this pull request to the merge queue Oct 23, 2026
Merged via the queue into main with commit 4791af3 Oct 23, 2026
23 checks passed
@kumarpallav-pplx
kumarpallav-pplx deleted the kumarpallav-pplx/warm-pool-blake3-content-hash branch October 23, 2026 04:20
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.

2 participants