Project sidecar writer registry#1058
Conversation
|
@codex review |
|
Warning Review limit reached
Next review available in: 14 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (55)
📝 WalkthroughWalkthrough
ChangesWriter registry projection
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Sidecar
participant EncryptionAdminServer
participant WriterRegistryStore
Sidecar->>EncryptionAdminServer: GetSidecarState または ResyncSidecar を呼び出す
EncryptionAdminServer->>WriterRegistryStore: DEK と caller node ID で registry 行を取得する
WriterRegistryStore-->>EncryptionAdminServer: registry 行を返す
EncryptionAdminServer-->>Sidecar: WriterRegistryForCaller を返す
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request implements the remaining Stage 7 §5.5 recovery surface for WriterRegistryForCaller by wiring the WriterRegistryStore into EncryptionAdminServer. Both GetSidecarState and ResyncSidecar now project the writer registry for the caller, returning the decoded LastSeenLocalEpoch for each DEK present in the sidecar. The review feedback correctly points out that returning codes.InvalidArgument when fullNodeID == 0 is misleading for GetSidecarState since it uses the local node's ID, and recommends returning codes.FailedPrecondition or codes.Internal instead.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Addressed latest-head review finding:
Caller audit:
Validation:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c8c99a0a8c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Addressed latest-head P2 review finding:
Validation:
|
|
Current head is green and the latest sidecar projection findings have been addressed with tests. @codex review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Current head already handles the remaining sidecar projection thread:
Verification:
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b3acb8331c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
b3acb83 to
39142ba
Compare
|
Resolved the latest-head findings in
Caller audit:
Verification:
History/author audit:
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
39142ba to
04bfde5
Compare
|
Rebased the signed stack onto current main |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 04bfde58f0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
04bfde5 to
e34b4de
Compare
|
Current head: e34b4de Resolved review findings:
Semantic caller audit:
Validation:
History audit:
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e34b4de8a6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Current head: a39527d Resolved latest-head findings:
Semantic caller audit:
Validation:
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a39527d37d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if err := e.capabilityProbe(ctx, address, newNodeFullID); err != nil { | ||
| return errors.Wrap(err, "encryption: refuse member before V2 capability confirmation") |
There was a problem hiding this comment.
Skip V2 probing when encryption is not configured
When the cluster runs without encryption/sidecar configuration, run() still constructs this interceptor because encWiring.cache is defaulted and the default group store exists, so AddVoter/AddLearner now reach this unconditional probe before the previous ActiveStorageKeyID no-op path. A target node with no sidecar reports full_node_id=0/encryption_capable=false, causing membership changes in non-encrypted deployments to fail even though the interceptor should be inert there; gate interceptor construction or this probe on encryption being configured rather than just on the cache existing.
Useful? React with 👍 / 👎.
## Summary - add AWS KMS, GCP KMS, and Vault Transit KEK wrappers - add the test/CI environment KEK source with immediate environment removal - enforce mutually exclusive file, URI, and environment sources - gate startup and encryption mutators on the wrapper that actually loaded - document Stage 9B completion ## Safety and compatibility - no envelope, sidecar, Raft opcode, or snapshot format changes - AWS requests bind a fixed encryption context - GCP requests bind AAD and verify CRC32C in both directions - Vault accepts only versioned Transit ciphertext and validates decoded DEK length - all providers reject empty, malformed, or non-32-byte responses before sidecar mutation ## Caller audit - KEK source resolution has one production caller before startup guards - `KEKConfigured` now derives from the loaded wrapper and reaches both startup refusal and the EncryptionAdmin mutator gate - existing bootstrap, rotation, hydration, and startup-rotation Wrap/Unwrap callers continue through the unchanged wrapper interface ## Verification - `go test ./... -count=1 -timeout=20m` - `go test -race ./internal/encryption/kek . -run ... -count=1 -timeout=15m` - `golangci-lint --allow-parallel-runners --config=.golangci.yaml run ./... --timeout=10m` (0 issues) - environment KEK Bootstrap -> storage cutover -> encrypted write -> snapshot -> restore -> plaintext readback integration - `git diff --check` ## Risk Remote provider availability and credentials are now startup dependencies when those providers are selected. Each remote operation has a 30-second deadline and startup fails closed when existing wrapped DEKs cannot be unwrapped. Author: bootjp <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **新機能** * AWS KMS、GCP KMS、Vault Transit、環境変数によるKEKプロバイダーに対応しました。 * KEKの入力元としてファイル、URI、環境変数を利用できるようになりました。 * 複数の入力元が設定された場合は起動を拒否し、安全に失敗します。 * 暗号化管理機能は、KEKが正常に読み込まれた場合のみ利用可能になりました。 * **改善** * KEK設定エラーの案内を拡充しました。 * 対応状況と残作業に関する設計ドキュメントを更新しました。 <!-- end of auto-generated comment: release notes by coderabbit.ai -->
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8b0889cd57
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if decompress { | ||
| plain, err = decompressAuthenticatedValue(plain, env.Flag) |
There was a problem hiding this comment.
Defer decompression until after TTL checks
The remaining read paths still call decryptForKey before checking ExpireAt (readVisibleVersion/processFoundValue), so this new decompression step expands compressed values even when the version is already expired and will be discarded. In TTL-heavy workloads a highly-compressible value can allocate up to maxSnapshotValueSize (256 MiB) on every expired Get/Scan, and malformed compressed bytes on an expired row now turn an absent-key result into a read error. Consider using the new authenticate-only path for the header check first, then decompress only for versions that are actually live.
Useful? React with 👍 / 👎.
Summary
WriterRegistryForCallerfrom the writer registry inGetSidecarStateandResyncSidecarEncryptionAdminserverValidation
git diff --checkgo test ./adapter -run 'TestEncryptionAdmin_(GetSidecarState|ResyncSidecar)' -count=1 -timeout=240sgo test ./adapter -run TestEncryptionAdmin -count=1 -timeout=300sgo test ./cmd/elastickv-admin -run 'TestEncryption(Status|Endpoint|Sidecar)' -count=1 -timeout=180sgo test ./store ./internal/encryption . -count=1 -timeout=180sgolangci-lint run ./adapter ./store ./internal/encryption . --timeout=5mAuthor: bootjp
Summary by CodeRabbit
新機能
ドキュメント