Skip to content

Add EdgeZero canary routing (rollout_pct flag + FNV-1a bucket assignment) (PR 19)#727

Open
prk-Jr wants to merge 8 commits into
feature/edgezero-pr18-phase5-verificationfrom
feature/edgezero-pr19-cutover-canary
Open

Add EdgeZero canary routing (rollout_pct flag + FNV-1a bucket assignment) (PR 19)#727
prk-Jr wants to merge 8 commits into
feature/edgezero-pr18-phase5-verificationfrom
feature/edgezero-pr19-cutover-canary

Conversation

@prk-Jr
Copy link
Copy Markdown
Collaborator

@prk-Jr prk-Jr commented May 21, 2026

Summary

  • Adds edgezero_rollout_pct (0–100) to the trusted_server_config store so EdgeZero traffic can be shifted incrementally without a deploy
  • Uses FNV-1a 32-bit hash of client_ip for deterministic, sticky per-user bucket assignment (0–99); routing predicate is bucket < rollout_pct
  • Fail-safe defaults: read error or invalid value → 0 (all legacy); absent key (backward compat) → 100 (all EdgeZero); rollout_pct = 0 is the immediate no-deploy rollback

Changes

File Change
crates/trusted-server-adapter-fastly/src/main.rs Added parse_rollout_pct, fnv1a_bucket, canary_routes_to_edgezero, read_rollout_pct; updated main() with canary dispatch; 11 unit tests (pinned FNV-1a vectors, distribution, boundary routing)
fastly.toml Added edgezero_rollout_pct = "0" to local Viceroy config store with ops comment
docs/internal/EDGEZERO_MIGRATION.md New ops runbook: config store keys, failure modes, pre-flight activation, 4 canary stages, pass/fail thresholds, rollback procedure, monitoring

Closes

Closes #500

Test plan

  • cargo test-fastly — 65 + 956 + 21 + 3 tests green
  • cargo test-axum — 31 tests green
  • cargo clippy-fastly && cargo clippy-axum — no warnings
  • cargo fmt --all -- --check — clean
  • JS tests: cd crates/js/lib && npx vitest run — 291 tests green
  • JS format: cd crates/js/lib && npm run format — clean
  • Docs format: cd docs && npm run format — clean
  • WASM build: cargo build --package trusted-server-adapter-fastly --release --target wasm32-wasip1
  • Manual testing via fastly compute serve with edgezero_rollout_pct = "1" and "0" (rollback)

Checklist

  • Changes follow CLAUDE.md conventions
  • No unwrap() in production code — use expect("should ...")
  • Uses log macros (not println!)
  • New code has tests
  • No secrets or credentials committed

prk-Jr added 8 commits May 21, 2026 14:26
When edgezero_enabled=true, reads edgezero_rollout_pct (0-100) from the
trusted_server_config store. Routes each request to EdgeZero if
fnv1a_bucket(client_ip) < rollout_pct, giving the ops team sticky
per-user canary control without a deploy.

Absent key defaults to 100 (full rollout, backward compatible with
edgezero_enabled=true deployments that predate this PR). Invalid values
and read errors default to 0 (all legacy, fail-safe).
Set to "0" so local dev and CI stay on the legacy path by default.
Ops changes this in the production config store — no re-deploy required.
Documents the two config store keys, canary progression stages (1% →
10% → 50% → 100%), hold-point durations, pass/fail thresholds, and
instant rollback procedure.
@prk-Jr prk-Jr self-assigned this May 21, 2026
@prk-Jr prk-Jr changed the title Add EdgeZero canary routing (rollout_pct flag + FNV-1a bucket assignment) Add EdgeZero canary routing (rollout_pct flag + FNV-1a bucket assignment) (PR 19) May 21, 2026
@aram356 aram356 requested review from ChristianPavilonis and aram356 and removed request for aram356 May 21, 2026 15:14
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