You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
WASI key-value store increment operations are not strictly idempotent across multiple backends #3563
The WASI wasi:keyvalue/atomics interface describes atomic operations as all-or-nothing: if a fault causes an atomic operation to fail, the caller should observe either that it completed successfully or that it did nothing.
Spin’s remote KV backends rely on each service’s native update primitive. This can leave ambiguous outcomes:
Azure Cosmos DB uses PATCH increment; if Cosmos commits the PATCH but the response is lost, retrying may apply the increment again because PATCH increment has no native idempotency token.
Redis uses INCR; if Redis applies the increment but the response is lost, retrying the command may also apply the increment again.
Avoiding retries prevents duplicate application, but Spin may still return an error even though the value changed.
This leaves a gap between the strict WASI fault semantics and what Spin can currently guarantee for remote KV stores. Fully closing it would likely require an internal exactly-once protocol, such as recording an operation id/result atomically with the counter update and reconciling ambiguous outcomes before returning. This is indeed not easy to implement, so I am documenting it as an issue for now.
changed the title [-]Gap: `wasi:keyvalue/atomics.increment` fault semantics on remote KV backends[/-][+]Gap in `increment` fault semantics for remote KV backends[/+]on Jun 10, 2026
changed the title [-]Gap in `increment` fault semantics for remote KV backends[/-][+]WASI kv store `increment` fault semantics gap in remote KV backends[/+]on Jun 10, 2026
changed the title [-]WASI kv store `increment` fault semantics gap in remote KV backends[/-][+]WASI key-value store `increment` operations are not strictly idempotent across multiple backends[/+]on Jun 10, 2026
Activity
[-]Gap: `wasi:keyvalue/atomics.increment` fault semantics on remote KV backends[/-][+]Gap in `increment` fault semantics for remote KV backends[/+][-]Gap in `increment` fault semantics for remote KV backends[/-][+]WASI kv store `increment` fault semantics gap in remote KV backends[/+][-]WASI kv store `increment` fault semantics gap in remote KV backends[/-][+]WASI key-value store `increment` operations are not strictly idempotent across multiple backends[/+]