Skip to content

Add portable conditional KV records across providers - #510

Draft
ChristianPavilonis wants to merge 9 commits into
feature/pluggable-geo-providersfrom
feat/kv-record-contract
Draft

ChristianPavilonis wants to merge 9 commits into
feature/pluggable-geo-providersfrom
feat/kv-record-contract

Conversation

@ChristianPavilonis

Copy link
Copy Markdown
Collaborator

Summary

  • Add portable conditional KV records with opaque generations, atomic Add/Overwrite/CAS, UTF-8 metadata, authoritative existence and complete partition-scoped listing. Ordinary and record operations use the same stored values.
  • Implement the capability for Fastly KV, Axum's persistent local store, DynamoDB and the EdgeZero-owned store service on official stock celld. Unsupported stores continue to refuse record operations.
  • Declare immutable layouts before preparation, then acquire the prepared capability. Forward native features through configuration and scaffolding without reopening providers or automatically replaying uncertain mutations.

Changes

Crate / File Change
edgezero-core Record types, capability/layout requirements, registry validation and shared contract tests.
Fastly and Axum adapters Conditional Fastly operations and durable local record transactions, generations, expiry and cursors.
edgezero-store-aws DynamoDB conditions, per-key retained allocation history, scoped partition queries/cursors and native item-size accounting.
services/celld-store Additive record API on the existing stock service rows and namespace object. Check the expected instance before effects and transactionally retain successful and rejected mutation outcomes for internal resend handling.
edgezero-store-celld Stock-service record client and read-only capability preparation. No celld fork, custom listener or extra deployment/bootstrap step.
Native bindings, CLI and templates Default-off record wiring, declaration/feature forwarding, alias validation and bootstrap-token capture for record bindings.
Tests, scripts and docs Provider contracts, actual generated consumers, stock celld fleet/restart/reply-loss proofs, feature-aware portable dependency checks and record guidance.

Closes

Closes #472
Closes #473

Stack placement

Base this PR on #439. #454 belongs above this PR; #464 belongs above #454 but remains outside official stack membership. Preserve existing PR identities and ordinary forward-merge ancestry.

flowchart TD
    A["#439: native Geo"] --> B["This PR: conditional records"]
    B --> C["#454: KV-backed Geo"]
    C --> D["#464: error finalization, outside stack membership"]
Loading

Test plan

Local verification uses Rust 1.98.1 with locked dependencies.

  • cargo test --workspace --all-targets after merging current Add pluggable native Geo providers and protected CloudFront ingress #439. Follow-up lint-only changes also pass the affected adapter and example tests.
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo fmt --all -- --check
  • cargo check --workspace --all-targets --features "fastly cloudflare spin"
  • examples/app-demo native workspace tests and strict all-target/all-feature Clippy.
  • Cloudflare and Spin all-target WASM Clippy for production and test-utils feature combinations, including affected lifecycle/ingress fixtures.
  • Isolated integration harness: 679 passed, four existing ignored; strict harness Clippy passes.
  • Prior provider/runtime proofs retained for unchanged provider/service code: persistent local records, DynamoDB Local, actual Fastly WASM KV cases, generated stock-celld TLS consumers, service restart/no-expiry persistence, independent writers, replay/rejection retention, committed-reply loss and two-node official celld takeover.
  • Complete hosted checks for this PR's exact head and intended base. A draft is intentional while checks and the deferred acceptance item below remain outstanding.

Known validation gap

The Viceroy emulator's record race can report more than one successful CAS writer. The one-winner assertion remains unchanged and the failed result remains disclosed. The emulator checks and replacement use separate locking intervals. Its repair is explicitly deferred; no retries for a favorable schedule, serialization, weakened assertions or runtime patch are included here. Successful individual runs do not establish atomicity. This does not establish a production Fastly defect or qualify the full Fastly concurrency acceptance criterion in #472.

Operational limits

Stock celld retains one serialized namespace object and allocator. Same-instance snapshot rollback/restore is not protected. Local/emulator proofs do not qualify production IAM, capacity, hosted fleets, backups or deployment. Native connector credentials remain outside published application configuration. No release, deployment, infrastructure apply or image publication is part of this PR.

Checklist

  • Follow repository conventions; changes are separated from inherited upstream repairs.
  • No Tokio dependency added to Core or portable adapters; portable checks inspect enabled features rather than version exceptions.
  • Route parameters use brace syntax and application HTTP types use EdgeZero's re-exports.
  • Store wiring uses the registries and prepared capabilities, not a second provider instance.
  • New behavior has contract, provider and runtime coverage with the limitations above stated separately.
  • No real credentials or secrets committed.

Preserve record and current stock-service/Geo ancestry. Add the service record API, prepared Rust client, generated TLS proofs and two-node resend/deadline/takeover checks.

Local checkpoint only. Native SDK, stock celld and strict lint checks pass; final SDK acceptance remains blocked by an observed Viceroy concurrent-CAS defect. Keep exact-one-winner assertions unchanged.

This branch has not been deployed

No deployments
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