Uh oh!
There was an error while loading. Please reload this page.
feat(cli): forward env-driven cluster driver to the runtime in os serve - #2226
Merged
Conversation
…rve` `os serve` constructed the Runtime without a cluster config, so it always used the in-memory cluster driver — a multi-replica deployment could not coordinate (and the split-brain guard blocked it). `os serve` now reads OS_CLUSTER_DRIVER (+ OS_REDIS_URL), dynamically imports the matching remote driver package (so it works in both config-boot and compiled-artifact mode), and forwards the cluster config to the Runtime. Open-core ships only the in-memory driver; remote drivers (e.g. @objectstack/service-cluster-redis) are provided by the EE distribution — absent ⇒ graceful fallback to in-memory. Verified via A/B boot (local redis): with OS_CLUSTER_DRIVER=redis + replicas=2 the server boots (guard passes = redis active); without it, replicas=2 trips the split-brain guard (memory). Enables the EE multi-node activation (cloud ADR-0018) of the cache-invalidation (#2213) and scheduler-leader-election (#2219) seams. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 15 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
os servebuilt the Runtime with no cluster config, so it always used the in-memory cluster driver. A multi-replica deployment therefore couldn't coordinate, and the split-brain guard (correctly) blocked it. This is the missing enabler that lets the EE distribution activate the cluster seams cross-node (cloud ADR-0018).What
os servereadsOS_CLUSTER_DRIVER(+OS_REDIS_URL), dynamically imports the matching@objectstack/service-cluster-<driver>package (so it works in both config-boot and compiled-artifact mode), and forwards{ driver, url }to theRuntime.OS_DATABASE_URLdriver-by-env pattern.Verification (A/B boot, local redis)
OS_CLUSTER_DRIVER=redis+OS_CLUSTER_REPLICAS=2→ boots (split-brain guard passes ⇒ redis active).OS_CLUSTER_DRIVER+OS_CLUSTER_REPLICAS=2→ process exits with the split-brain guard (in-memory driver).Clean A/B proves the forwarding wires redis into the Runtime. Build Core type-checks the change (serve.ts has no unit-test harness).
🤖 Generated with Claude Code