cockpit-server: close the last 3 eager-singleton triggers for chains/books - #140
Conversation
…hains/books Follow-up to the tile-shapes Lance rewrite: query_feature/osm_feature_handler, query_geometry/osm_geometry_handler, and osm_health_handler were the three call sites still hitting open_chains()/open_books() directly. All three now gather from Lance with eager-singleton fallback, same contract as the tile handlers. feature_ordinals(bytes, idx) reads a row once to collect its identity ordinal + tag key/value ordinals (single-row sibling of tile_sources's many-row version). single_gather_chains/single_gather_books are the shared gather helpers, factored out of tile_sources so all four handlers share one gather implementation per side instead of four. osm_health_handler needed a genuinely new piece: it can't just gather (it needs to answer "is this sidecar valid for the CURRENT slab", the same digest check open_books()/open_chains() perform internally, without loading either). Companion sibling-repo commit (openstreetmap-website-rs) adds two header-only readers - osm_soa_bake::codebook::read_books_header (~40 bytes) and osm_soa_bake::chains::read_chains_header (24 bytes) - each proven by a truncated-buffer falsifier to genuinely stop at the header rather than just returning the right answer on a complete file. books_header_valid_for_slab/ chains_header_valid_for_slab wire these into the health endpoint. Every request path that could reach open_chains()/open_books() now reads from Lance or a header-only check first. No remaining trigger in the request path for the permanent multi-GB residency this plan targeted. Test: books_and_chains_header_validity_agrees_with_the_real_slab_digest - first test in osm_features.rs to set OSM_SLAB_PATH and exercise the real slab_digest() OnceLock end-to-end (safe under nextest's one-process-per-test model), proving both the digest-match and digest-mismatch cases against a real computed digest. Verified: cargo check -p cockpit-server --tests (clean), cargo nextest run -p cockpit-server --bin q2-cockpit osm_features (21/21, was 20) and osm_chains_books_lance (7/7, unaffected).
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Important Review available on request
Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_61bf222e-e080-45ee-bea3-9c916ea61060) |
Summary
Follow-up to #139 (merged):
query_feature/osm_feature_handler,query_geometry/osm_geometry_handler, andosm_health_handlerwere the three call sites still hittingopen_chains()/open_books()directly. All three now gather from Lance with eager-singleton fallback, same contract as the tile handlers.feature_ordinals(bytes, idx)reads a row once to collect its identity ordinal + tag key/value ordinals (single-row sibling oftile_sources's many-row version).single_gather_chains/single_gather_booksare the shared gather helpers, factored out oftile_sourcesso all four handlers share one gather implementation per side instead of four.osm_health_handlerneeded a genuinely new piece: it can't just gather — it needs to answer "is this sidecar valid for the CURRENT slab" (the same digest checkopen_books()/open_chains()perform internally) without loading either. Companion sibling-repo PR (AdaWorldAPI/openstreetmap-website-rs#31) adds two header-only readers —osm_soa_bake::codebook::read_books_header(~40 bytes) andosm_soa_bake::chains::read_chains_header(24 bytes) — each proven by a truncated-buffer falsifier to genuinely stop at the header.books_header_valid_for_slab/chains_header_valid_for_slabwire these into the health endpoint. The JSON response's"loaded"key name is unchanged for monitoring compatibility; it now means "header valid for the current slab" rather than "resident in memory" (documented inline).Every request path that could reach
open_chains()/open_books()now reads from Lance or a header-only check first. No remaining trigger in the request path for the permanent multi-GB residency this plan targeted.Test plan
books_and_chains_header_validity_agrees_with_the_real_slab_digest— the first test inosm_features.rsto setOSM_SLAB_PATHand exercise the realslab_digest()OnceLockend-to-end (safe under nextest's one-process-per-test model), proving both the digest-match and digest-mismatch cases against a real computed digest, not just that a header parses.cargo check -p cockpit-server --tests— clean.cargo nextest run -p cockpit-server --bin q2-cockpit osm_features— 21/21 passing (was 20; the one new test is the digest end-to-end proof above).cargo nextest run -p cockpit-server --bin q2-cockpit osm_chains_books_lance— 7/7 passing, unaffected.See
claude-notes/plans/2026-08-16-chains-books-lancedb-blob.mdfor the full history.Generated by Claude Code