fix(msk): isolate MSK resources by account and region - #3353
Conversation
|
🎉 Thanks for your first pull request to Floci! Your CI checks need a maintainer to approve them before they run. That is GitHub's standard gate on first-time contributors, not a problem with your PR — so if the checks look like they are doing nothing, that is why. Once a maintainer approves, CI and the compatibility suite start automatically. Nothing is needed from you in the meantime. While you wait, a couple of things that make review faster:
Come join us in Slack — it is the fastest way to reach maintainers if you get stuck, or want feedback on an approach before investing more time in it. |
|
| Filename | Overview |
|---|---|
| src/main/java/io/github/hectorvent/floci/services/msk/MskService.java | Persists request-region identity and applies compatible regional filtering to MSK operations. |
| src/main/java/io/github/hectorvent/floci/services/msk/RedpandaManager.java | Isolates log streams, labels, and host storage by cluster account and region while preserving legacy data access. |
| src/main/java/io/github/hectorvent/floci/services/msk/model/MskCluster.java | Adds the persisted resource-region marker used to distinguish scoped clusters from legacy records. |
| src/test/java/io/github/hectorvent/floci/services/msk/MskServiceTest.java | Covers same-name regional clusters, cross-region access restrictions, and legacy record visibility. |
| src/test/java/io/github/hectorvent/floci/services/msk/RedpandaManagerTest.java | Covers account-aware logging, scoped host paths, and guarded legacy path reuse. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
Request[MSK request] --> Context[Resolve account and region]
Context --> Cluster[Create or select cluster]
Cluster --> ARN[Account and region scoped ARN]
ARN --> Logs[Account and region scoped broker logs]
ARN --> Storage{Legacy record?}
Storage -->|No| Scoped[Scoped host data path]
Storage -->|Yes and legacy path exists| Legacy[Legacy cluster-name path]
Storage -->|Yes and legacy path absent| Scoped
Reviews (4): Last reviewed commit: "ci: retrigger PR checks after unrelated ..." | Re-trigger Greptile
pgermosen
left a comment
There was a problem hiding this comment.
Traced this against the existing account-scoping mechanism rather than assuming it duplicates it: cluster metadata already gets that for free from AccountAwareStorageBackend, so the real gap closed here is region on the metadata side and both account+region on the RedpandaManager log/host-path side. Deriving region and account from the cluster's own ARN rather than live request context is the right call for a background lifecycle thread. The legacy-record fallback is explicitly reasoned in a comment, not an oversight. Approving.
Summary
MSK broker logs and legacy host-persistent storage are now isolated by AWS account and region. This prevents resources with the same cluster name in different environments from sharing log streams or data directories.
Type of change
fix:)feat:)feat!:orfix!:)AWS Compatibility
MSK cluster identity includes the account and region. Floci now uses that identity when attaching broker logs and constructing the legacy host storage path, while preserving the existing cluster name in user-facing log labels and container labels.
Checklist
./mvnw testpasses locally