Uh oh!
There was an error while loading. Please reload this page.
fix(security): invalidate metadata-derived caches on runtime metadata change - #2213
Merged
Merged
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 8 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
… change
SecurityPlugin's fieldNames/tenancy/controlled-by-parent caches were populated
lazily from metadata but never invalidated — so runtime metadata edits (Studio /
AI authoring) served stale schema/RLS until restart, even single-node. Subscribe
to metadata.watch('*') in start() and clear them on change.
Generic open-core mechanism (guarded on the optional watch API). With a cluster
pub/sub driver the metadata.changed event propagates cross-node, so this is also
the groundwork for cross-node cache invalidation in EE multi-node (cloud ADR-0018).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>xuyushun441-sysforce-pushed
the
seam/cache-invalidation-on-metadata-change
branch
from
June 22, 2026 14:48
c27aebd to
895d9e5CompareUh oh!
There was an error while loading. Please reload this page.
xuyushun441-sys added a commit
that referenced
this pull request
Jun 22, 2026
…rve` (#2226) `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: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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
SecurityPlugin的fieldNamesCache/tenancyDisabledCache/cbpRelCache从元数据惰性填充,但从不失效。"元数据在 kernel 生命周期内不变"的假设在运行时改元数据(Studio / AI Studio 在线建模)时被打破——schema/RLS 会读到旧值直到重启,单节点也如此。What
start()订阅metadata.watch('*'),元数据变更时清这三个缓存。watchAPI 做了 guard)。配合 cluster pub/sub 驱动时,metadata.changed会跨节点传播 → 这也是 EE 多节点跨节点缓存失效的铺底(见 cloud ADR-0018)。影响
🤖 Generated with Claude Code