Skip to content

feat(ladybug-graph): register real engine partition-routing hooks - #2

Merged
adsharma merged 8 commits into
ladybugfrom
ladybug-graph-routing-hooks
Sep 21, 2026
Merged

adsharma merged 8 commits into
ladybugfrom
ladybug-graph-routing-hooks

Conversation

@adsharma

@adsharma adsharma commented Sep 20, 2026 •

Copy link
Copy Markdown

Wires the example up to the real distributed hooks via lbug::RoutingGuard (LadybugDB/ladybug-rust#40, now merged), replacing the client-side-only story.

What

  • examples/ladybug-graph/Cargo.toml: lbug tracks ladybug-rust main via git (pinned past [SVC-2367] Remove salt-key for deleted servers rivet-dev/rivet#40) until a crates.io release carries RoutingGuard — flips to a version req in ladybug-graph: switch lbug back to a version dependency after hooks release #3. No sibling checkout assumed, so plain GitHub runners can build it.
  • ladybug_server.rs: new install_local_hooks() installing all-local hooks with lifecycle logging. Held for process lifetime in bin/ladybug-server.rs and the standalone demo.
  • tests/routing.rs (new target, own process since hooks are process-global): claims a dedicated Remote HASH table, proves point + COPY writes served from the bundled row store, ordered parent-union reads, and 3x create/drop lifecycle — all through the engine over ADBC.
  • Docs updated (partitioning.rs header, README). No LBUG_LIBRARY_DIR/LBUG_INCLUDE_DIR overlay: shipped prebuilts carry the hooks since Ship partition routing hooks in the amalgamated lbug.hpp LadybugDB/ladybug#1005 (also merged).
  • .github/workflows/rust.yml: check runs on ubuntu-latest (no depot runners on this fork) and resolves LBUG_PRECOMPILED_RUN_ID from the latest successful LadybugDB/ladybug main build, mirroring ladybug-rust's CI. Also fixes two pre-existing universaldb ladybug-driver compile errors the check surfaced (approximate_size stub, MaxRetriesReached payload) plus cargo fmt diffs.

Verification

Full suite green (4 lib + 11 kcore + 1 routing + 1 doctest) against the git lbug with plain prebuilt download (post-rivet-dev#1005 run); cargo fmt --all -- --check clean; cargo check --workspace --exclude rivetkit-wasm (with CI's deny-warnings flags) green.

Notes for reviewers

…rtitioning

Store one partition subgraph per community via PARTITION BY LIST(cluster) instead of HASH(server). Each vertex starts as its own community and WCC improvements physically migrate rows with delete + insert (move_vertex_to_cluster), since the engine refuses in-place partition-key updates. The Edge rel table is declared after seeding so rel coverage includes every initial cluster, and PartitionRouter discovers the engine's value-to-partition map from the catalog. Msg stays HASH-partitioned by compute shard.
Point the example at a local ladybug-rust checkout carrying the RoutingGuard bindings and install real hooks: the server binary and standalone demo register all-local hooks with lifecycle logging before opening the store, and a new tests/routing.rs target proves the full remote loop (claim a dedicated HASH table, point + COPY writes served from the bundled row store, ordered parent scans, create/drop lifecycle) through the engine over ADBC. PartitionRouter stays as the client-side discovery complement; direct reads of claimed partitions are engine-rejected (parent scans only). Teardown joins the server thread before removing the temp dir, which shutdown checkpointing requires once partitions are claimed.
@adsharma
adsharma merged commit 42f6117 into ladybug Sep 21, 2026
4 checks passed
@adsharma
adsharma deleted the ladybug-graph-routing-hooks branch September 21, 2026 06:00
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