Repository navigation
Publish RBAC changes once durable metadata is written, even if staging fails - #79
Merged
Merged
Conversation
Extract the existing durable-then-staging sequence behind injected writers without changing its behavior. Regress the staging failure that incorrectly prevents callers from publishing a successful durable update, and cover durable failure and successful ordering. Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
Remote metadata is authoritative at runtime and startup. Log a failed local staging refresh with tenant context and return success once the durable write commits, so callers continue their live map and session updates. Keep durable write errors fatal and route the standalone role and OIDC writers through the shared helper. Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
VibeSWE
commented
Oct 25, 2026
VibeSWE
left a comment
Author
There was a problem hiding this comment.
Adversarial review of PR #79 (at ef0b3084)
One Opus 5.5 and one Sol 6.1 reviewer. Neither found anything blocking.
Remote metadata is authoritative on every path:
- Startup:
resolve_parseable_metadataonly uses staging to check that the file exists and that itsdeployment_idmatches. It loads RBAC from remote and rewrites staging from remote. - Migrations: they handle remote and staging separately, and the stale staging copy is then overwritten.
- Runtime:
get_metadatanever falls back to staging. - No overwrite of remote: the reviewers found no path where stale staging can overwrite remote.
All 19 callers were traced; none reads staging back after put_metadata. The role.rs and oidc.rs copies that were removed were byte-for-byte the same as the shared helper.
| Severity | Finding | Outcome |
|---|---|---|
| Low | A partly written staging file (ENOSPC mid-write) still panics the next startup, and now the operator only sees an error! log, not a 500 |
Pre-existing; noted in the PR body. Atomic staging writes are follow-up work |
| Low | The staging_dir == storage.root guard compares paths as strings (./data vs /abs/data) |
Pre-existing misconfiguration edge case; follow-up |
| Nit | Ingestor sync handlers still drop staging errors with let _ |
Being addressed in the ingestor sync PRs |
| Nit | The log line could include the file path | Left as is: I/O errors usually carry the path |
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.
Summary
Follow-up from the #67 review (pre-existing, Medium): a staging-write failure in
put_metadataleft this node's live authorization behind durable state.put_metadatawrites RBAC metadata to object storage, then to local staging.Err. Callers then skipped updating the in-memory maps and sessions.Fix:
tracing::error!(with tenant context) andput_metadatareturnsOk, letting callers publish the change.I audited all 19 callers; none handles the staging error separately.
Tests
The remote-then-staging sequence is factored so it can be tested with injected writers. Committed red first:
PermissionDeniedafter a successful remote write returnsOk;Errand skips staging;Verification
cargo fmt --check✅,cargo clippy -- -D warnings✅cargo test --lib: 1024 passed, 0 failed, 2 ignoredRemaining risk
A failed staging write can leave a stale or partial staging file, and startup parsing can still fail on a corrupt one. Atomic staging writes are separate work.
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.