feat: add DeleteWithConfig/DeleteConfig with generation support to kvstore#263
feat: add DeleteWithConfig/DeleteConfig with generation support to kvstore#263mvanhorn wants to merge 3 commits into
Conversation
…eroy Viceroy <= 0.18.0 (bundled by the CI Fastly CLI) only defines the reserved delete-config flag in its WITX and its kv_store delete impl ignores the config, so calling delete with if_generation_match traps in the guest. Skip the two generation-aware delete subtests with that rationale until a Viceroy that implements the ABI ships.
|
The No released Viceroy implements it, so rather than bump Viceroy I gated the two generation-aware delete subtests ( |
|
Let's put this on hold until we have updated wit file definitions with the appropriate flag values, and the hostcalls have been implemented in viceory. Thanks for all your work! |
Summary
KV Store gets a
DeleteWithConfig(key, *DeleteConfig)operation so anif-generation-matchprecondition can be supplied on deletes, mirroring theIfGenerationMatchfield that already landed on the insert side.Why this matters
#255 (from @kpfleming) asked for two additions; @dgryski noted the InsertConfig half shipped in PR #246, leaving the delete half. This adds the public
DeleteWithConfigAPI plus the ABI plumbing for theif-generation-matchprecondition on the delete hostcall. The plainDelete(key)signature is unchanged, so existing callers are unaffected, and the non-guest stub (hostcalls_noguest.go) is updated to match the new ABI so thekvstorepackage keeps compiling under the default build tags.Testing
Integration test in
integration_tests/kvstore/main_test.gocovers a generation-matched delete (succeeds) and a stale-generation delete (precondition rejected).go test ./kvstorecompiles under both wasip1 and default build tags.Fixes #255