Repository navigation
Description
Description
The KV Geo tool in examples/geo-kv-prototype publishes only to celld or DynamoDB. Axum's production runner already prepares a local redb store for an unbound Geo store ID, but nothing can put an artifact into it. A single-process Axum deployment that wants KV Geo therefore has to run celld or DynamoDB Local next to it, only to hold a read-only index.
Steps to reproduce
-
Build Trusted Server's Axum adapter with
geo-kvon a revision that includes Portable KV-backed Geo lookup #454. -
Build an artifact from a GeoLite City CSV with
geo-kv-prototype build. -
Start the server with KV Geo selected and no store binding for
geo_index:EDGEZERO__ADAPTER__DATA_DIR=/data EDGEZERO__ADAPTER__GEO__PROVIDER=kv EDGEZERO__ADAPTER__GEO__STORE_ID=geo_index EDGEZERO__ADAPTER__GEO__PIN=<generation>@<manifest sha256> EDGEZERO__ADAPTER__GEO__READER_IP=forwarded-required
-
Startup creates
/data/kv-geo-index-<hash>.redbnext to the record store's file, then exits before listening withnative_geo: pinned KV data could not be prepared.
The local store exists and is the right shape. It is empty because no tool writes to it.
Expected behavior
geo-kv-prototype publishcan target the Axum local KV store, given the data directory and the logical store ID.- It opens the same file the runner derives for that ID. Today
kv_store_file_nameindev_server.rsis private, so the derivation needs to be exposed or wrapped in a constructor. - Publication keeps its existing contract: read before write, skip identical bytes, abort on different bytes, read back, manifest last.
verify-remoteworks against the same store. - redb lets one process open the file (
DatabaseAlreadyOpen), so publishing happens while the server is stopped. The tool reports that case clearly rather than waiting. - The serving reader doesn't change. It still reads through
KvHandle.
Impact
On Trusted Server, an Unknown jurisdiction fails closed in allows_ec_creation, so without Geo no Edge Cookie is ever issued. A developer running TS on Axum locally can't exercise identity unless they also run celld or DynamoDB Local and publish an index. The same applies to single-node self-hosted Axum (#391). Trusted Server's test lab runs a celld per instance only for this.
Proposed fix
Add a backend to the tool behind a feature, for example axum-local, that opens EdgeZero's Axum persistent KV store at the path the runner uses. Expose that path derivation from edgezero-adapter-axum. Document in native-geo.md that an unbound Geo store ID uses the local provider, and how to fill it.
Out of scope: making a local store the default, publishing while the server runs, and any change to selection precedence, the reader or consent policy.
Done when
-
publishandverify-remotework against the Axum local store, with interrupted, identical and conflicting publication covered as for the other backends. - The tool and the runner derive the same file from one shared function.
- A managed Axum test starts with an unbound Geo store ID filled by the tool, and resolves sampled lookups that match the CSV oracle.
- Opening the store while the server holds it fails with a clear message.
-
native-geo.mddescribes the local store and its single-process limit.
Related
- KV Geo: Axum: follow up with an explicit local GeoIP provider #438, PR Portable KV-backed Geo lookup #454
- Self-hosted Axum: Make the Axum adapter production-ready for self-hosted deployments #391
- Server-side identity on every adapter: Platform capabilities for server-side identity on every adapter #468
Activity