Skip to content

feat: implement LIP-0000 Catalog foundation MVP - #3

Closed
mattisonchao wants to merge 12 commits into
mainfrom
feat/lip-0000-mvp
Closed

mattisonchao wants to merge 12 commits into
mainfrom
feat/lip-0000-mvp

Conversation

@mattisonchao

@mattisonchao mattisonchao commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Motivation

Implement the Catalog side of approved LIP-0000 in one MVP PR. The foundation needs explicit initialization, two independently registered stateless processes, and shared configuration/observability before adding database-management behavior.

Modifications

  • Replace implicit startup/serve with init --manifest ... --password-file ... and start --manifest .... Use strict TOML with metadata.oxia, server.public, server.health, server.tokio_console and observability.*.
  • Pin the shared Meta MVP by immutable Git revision (companion feat: implement LIP-0000 shared foundation MVP meta#3); no local path dependency.
  • Initialize through Meta only. Protect and validate the separate password file; retain the existing root/database identity on retries.
  • Register directly through Metadata once at startup. Serve active-active without a writer lease. Fresh /live and /ready checks distinguish transient metadata uncertainty from terminal monitor/ownership failure.
  • Reuse Meta's manifest watcher, JSON logging, OTel/Prometheus server, runtime metrics, pprof and Tokio Console. Keep process-specific routing/runtime ownership here.
  • Keep SCRAM authentication and read-only PostgreSQL queries/inventory, including SHOW DATABASES and current_database(). General database/user/schema DDL is deliberately not admitted in this foundation.
  • Add a symbolized Linux image with Tokio instrumentation, the Lyra banner, strict-manifest example, repository instructions/symlink and CI.
  • Release each connection's private compatibility catalog on last-owner drop. A regression test proves the catalog/schema/metadata reference cycle is broken without affecting other sessions or stored metadata.

Testing

  • Passed local workspace tests: two independently registered Catalogs authenticate against the same metadata namespace, read-only queries succeed, DDL and invalid credentials are rejected, and system-database admission is refused.
  • Passed manifest/password validation, command-shape tests, formatting and Clippy.
  • Passed private HTTP route tests, including Linux capture-disconnect cancellation, HEAD rejection, invalid query bounds and closed-client probe responses. The Linux Rust CI job passed for the deployed code revision.
  • Built and deployed final mattison/lyra-catalog:362cf90 to the retained kind-lyra cluster as two ready active-active replicas, with the separate toolbox and three-member Oxia cluster. Direct SQL to each replica and service SQL passed; existing database IDs/names were preserved. Database DDL is rejected explicitly. One service attempt immediately after rollout timed out; subsequent checks confirmed two ready endpoints and passed. The transient's precise cause was not isolated.
  • Restarted one Oxia member with its PVC retained and temporarily isolated one Catalog from metadata. The affected Catalog stayed live (200) but unready (503), responding in ~805 ms; the peer remained ready and served SQL. After removing isolation the same UUID recovered without a Catalog restart. Oxia returned to three healthy members and one RF=3 shard.
  • Applied all eleven hot observability fields through the projected ConfigMap without pod replacement; invalid candidates retained the previous generation/settings. Prometheus path changes and disable/re-enable retained counters; pprof/Console disable closed their interfaces. Verified all fourteen metric families after exercising reloads.
  • Collected a CPU profile from the actual stripped-debug runtime image during SQL work; pprof resolved Rust/DataFusion/Catalog symbols. Disconnecting a 30-second HTTP capture released it before its original duration. Tokio Console connected successfully when enabled; it is disabled again for normal use.
  • Ran the chart's explicit protected-file initialization Job and a second idempotent init against disposable metadata. The second run reported no changes. Normal Catalog pods do not mount the bootstrap Secret.
  • Fresh archived checkouts resolve AGENTS.md -> CLAUDE.md. Temporary fault policies, Jobs and test namespaces were removed.

Review notes

  • Ready for MVP review; no merge requested. Final image 362cf90 includes Meta 98b426c and the connection-cycle fix. Two hundred short SQL sessions completed around a hot Console enable, followed by another hundred with an attached Console client and concurrent two-second symbolized CPU capture; both pods stayed ready with zero restarts. Normal Console-disabled settings are restored.
  • Companion PRs: Meta #3, charts #1. No PR is merged.
  • Catalog pins Meta by immutable revision. After Meta is squash-merged, update this same PR's dependency pin/lockfile to the resulting merge commit before merging Catalog.
  • Additional load checks on 38889bb passed 200 short SQL sessions with Console disabled (~80 MB RSS) and 500 with Console enabled (RSS plateaued around 509 MB after retention elapsed, no restarts). These are spot checks, not a throughput/tail-latency benchmark; retained Console history consumes additional memory. Images are built/loaded locally, not published to Docker Hub. Latest CI is visible in Checks.
  • Connect without port forwarding: kubectl --context kind-lyra -n lyra exec -it deployment/lyra-toolbox -c toolbox -- psql.
  • Longer diagnostics stress, full tail-latency comparisons and the proposal's isolated deadlock/blocked-worker/external-backtrace demonstrations remain validation follow-ups. No claim of universal deadlock detection or production performance qualification.

@mattisonchao
mattisonchao marked this pull request as ready for review October 2, 2026 00:02
@mattisonchao

Copy link
Copy Markdown
Member Author

Superseded: this is the old LIP-0000 foundation MVP (SQL parser/planner under catalog/src/sql/). main already ships the LIP-0001 database-management implementation (command/state/query + DataFusion), so merging this would revert main and conflict. Closing instead of merging.

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