Repository navigation
feat(server): refresh read-replica API key index via store watcher - #3857
Merged
Merged
Conversation
Read replicas load the API key store once at startup and never rewrite it, so a user registered/rotated/removed on the writer stays invisible (new key -> "Invalid API Key"; removed key -> still accepted). Add an optional background watcher that polls the shared key store and reloads the in-memory index only when it actually changes: - APIKeyManager.reload(): strictly read-only refresh that rebuilds state and swaps it in atomically, never writing or migrating plaintext keys. - compute_store_signature(): cheap (path, size, modTime) signature over accounts.json + every users.json so the watcher skips unchanged polls. - ApiKeyAuthPlugin starts/stops the watcher behind api_key_watch_enabled (default off) with api_key_watch_interval_seconds; AuthPlugin.shutdown() is wired into app shutdown to cancel it cleanly. Add coverage for reload convergence, read-only/no-migrate guarantees, uninitialized-store tolerance, signature change detection, and watcher reload/skip/shutdown behavior. Co-authored-by: TRAE CLI <noreply@bytedance.com>
fengluodb
force-pushed
the
chore/ov-load-account
branch
from
August 7, 2026 06:24
ad8b01b to
e3e9b6c
Compare
qin-ctx
requested changes
Aug 8, 2026
qin-ctx
left a comment
Collaborator
There was a problem hiding this comment.
本次 Review 只提交必须修复项:
- 只读副本的生产启动仍会先走可写
load(),因此无法覆盖 PR 声称支持的“reader 先于 writer 启动”场景。 - watcher 的 reload 与账号/用户管理写入没有共同的并发边界,可以让创建接口成功返回一个立即无效的 Key。
qin-ctx
approved these changes
Aug 10, 2026
skloxo
pushed a commit
to skloxo/OpenVikingStudio
that referenced
this pull request
Aug 22, 2026
…olcengine#3857) Read replicas load the API key store once at startup and never rewrite it, so a user registered/rotated/removed on the writer stays invisible (new key -> "Invalid API Key"; removed key -> still accepted). Add an optional background watcher that polls the shared key store and reloads the in-memory index only when it actually changes: - APIKeyManager.reload(): strictly read-only refresh that rebuilds state and swaps it in atomically, never writing or migrating plaintext keys. - compute_store_signature(): cheap (path, size, modTime) signature over accounts.json + every users.json so the watcher skips unchanged polls. - ApiKeyAuthPlugin starts/stops the watcher behind api_key_watch_enabled (default off) with api_key_watch_interval_seconds; AuthPlugin.shutdown() is wired into app shutdown to cancel it cleanly. Add coverage for reload convergence, read-only/no-migrate guarantees, uninitialized-store tolerance, signature change detection, and watcher reload/skip/shutdown behavior. Co-authored-by: TRAE CLI <noreply@bytedance.com> (cherry picked from commit 9097fef)
frankyang2008-eng
added a commit
to frankyang2008-eng/OpenViking
that referenced
this pull request
Oct 9, 2026
Sync upstream main (e546b79) - 19 commits, 315 files: - refactor(client): remove Python embedded mode (volcengine#3712) - perf(queue): stream semantic vectorization tasks (volcengine#3636) - perf(queuefs): defer embedding content materialization (volcengine#3871) - feat(memory): support event tag filtering (volcengine#3850) - feat(pathlock): keep lease alive across handoff (volcengine#3903) - feat(server): refresh read-replica API key index via store watcher (volcengine#3857) - feat(agent-evolution): add trajectory date filters (volcengine#3915) - feat(agent-evolution): add trajectory task query (volcengine#3856) - feat(web-studio): add account deletion workflow (volcengine#3912) - feat(web-studio): add scheduled resource sync management (volcengine#3909) - fix(watch): avoid global lock during resource moves (volcengine#3833) - fix(observer): ignore historical lock diagnostics in health (volcengine#3920) - fix(session): validate archive names when loading history (volcengine#3922) - fix(task-tracker): delete expired persisted tasks (volcengine#3913) - fix(storage): exclude zero-byte files from index expectations (volcengine#3904) - fix(semantic): reduce entity hallucinations in summaries (volcengine#3908) - fix(retrieval): record first-turn session recalls (volcengine#3907) - fix(opencode-plugin): serialize saveState to prevent ENOENT race (volcengine#3885) - fix(examples): align quick start with server mode (volcengine#3923) Reviewed: zero conflicts, all local dev-branch modifications preserved, no references to deleted embedded client modules, config backward-compatible.
frankyang2008-eng
pushed a commit
to frankyang2008-eng/OpenViking
that referenced
this pull request
Oct 9, 2026
…olcengine#3857) Read replicas load the API key store once at startup and never rewrite it, so a user registered/rotated/removed on the writer stays invisible (new key -> "Invalid API Key"; removed key -> still accepted). Add an optional background watcher that polls the shared key store and reloads the in-memory index only when it actually changes: - APIKeyManager.reload(): strictly read-only refresh that rebuilds state and swaps it in atomically, never writing or migrating plaintext keys. - compute_store_signature(): cheap (path, size, modTime) signature over accounts.json + every users.json so the watcher skips unchanged polls. - ApiKeyAuthPlugin starts/stops the watcher behind api_key_watch_enabled (default off) with api_key_watch_interval_seconds; AuthPlugin.shutdown() is wired into app shutdown to cancel it cleanly. Add coverage for reload convergence, read-only/no-migrate guarantees, uninitialized-store tolerance, signature change detection, and watcher reload/skip/shutdown behavior. Co-authored-by: TRAE CLI <noreply@bytedance.com>
skloxo
pushed a commit
to skloxo/OpenVikingStudio
that referenced
this pull request
Nov 9, 2026
…olcengine#3857) Read replicas load the API key store once at startup and never rewrite it, so a user registered/rotated/removed on the writer stays invisible (new key -> "Invalid API Key"; removed key -> still accepted). Add an optional background watcher that polls the shared key store and reloads the in-memory index only when it actually changes: - APIKeyManager.reload(): strictly read-only refresh that rebuilds state and swaps it in atomically, never writing or migrating plaintext keys. - compute_store_signature(): cheap (path, size, modTime) signature over accounts.json + every users.json so the watcher skips unchanged polls. - ApiKeyAuthPlugin starts/stops the watcher behind api_key_watch_enabled (default off) with api_key_watch_interval_seconds; AuthPlugin.shutdown() is wired into app shutdown to cancel it cleanly. Add coverage for reload convergence, read-only/no-migrate guarantees, uninitialized-store tolerance, signature change detection, and watcher reload/skip/shutdown behavior. Co-authored-by: TRAE CLI <noreply@bytedance.com> (cherry picked from commit 9097fef)
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 free
to 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.
Read replicas load the API key store once at startup and never rewrite it, so a user registered/rotated/removed on the writer stays invisible (new key -> "Invalid API Key"; removed key -> still accepted).
Add an optional background watcher that polls the shared key store and reloads the in-memory index only when it actually changes:
Add coverage for reload convergence, read-only/no-migrate guarantees, uninitialized-store tolerance, signature change detection, and watcher reload/skip/shutdown behavior.
Description
Human Involvement
Related Issue
Type of Change
Changes Made
Testing
Checklist
Screenshots (if applicable)
Additional Notes