[vm|vl|vt]cluster: properly generate storageNode command line flags when HPA enabled on a storage#2119
Open
AndrewChubatiuk wants to merge 3 commits intomasterfrom
Open
[vm|vl|vt]cluster: properly generate storageNode command line flags when HPA enabled on a storage#2119AndrewChubatiuk wants to merge 3 commits intomasterfrom
AndrewChubatiuk wants to merge 3 commits intomasterfrom
Conversation
…hen HPA enabled on a storage
0fc7585 to
ed05b2b
Compare
Contributor
There was a problem hiding this comment.
3 issues found across 11 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="api/operator/v1/vlcluster_types.go">
<violation number="1" location="api/operator/v1/vlcluster_types.go:792">
P1: Handle HPA configs with omitted `minReplicas`; otherwise `AvailableStorageNodeIDs` returns no nodes and generates empty storage targets.</violation>
</file>
<file name="api/operator/v1/vtcluster_types.go">
<violation number="1" location="api/operator/v1/vtcluster_types.go:703">
P1: When HPA is set but `minReplicas` is omitted, `replicaCount` remains 0 and no storage nodes are generated. Default this path to 1 replica (Kubernetes HPA default) so `-storageNode` flags are still built.</violation>
</file>
<file name="docs/CHANGELOG.md">
<violation number="1" location="docs/CHANGELOG.md:21">
P2: Custom agent: **Changelog Review Agent**
Changelog entry uses implementation-detail wording and misses explicit before/after user-visible explanation required by the changelog rule.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> Signed-off-by: Andrii Chubatiuk <andrew.chubatiuk@gmail.com>
Contributor
There was a problem hiding this comment.
1 issue found across 3 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="api/operator/v1/vlcluster_types.go">
<violation number="1" location="api/operator/v1/vlcluster_types.go:796">
P2: Avoid local defaulting of optional HPA replica fields here; set this default in centralized CR defaulting instead so all controllers/use-sites observe the same value.
(Based on your team's feedback about relying on centralized CR defaulting for optional pointer fields.) [FEEDBACK_USED]</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.
| if cr.Spec.VLStorage.HPA.MinReplicas != nil { | ||
| replicaCount = *cr.Spec.VLStorage.HPA.MinReplicas | ||
| } else { | ||
| replicaCount = 1 |
Contributor
There was a problem hiding this comment.
P2: Avoid local defaulting of optional HPA replica fields here; set this default in centralized CR defaulting instead so all controllers/use-sites observe the same value.
(Based on your team's feedback about relying on centralized CR defaulting for optional pointer fields.)
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At api/operator/v1/vlcluster_types.go, line 796:
<comment>Avoid local defaulting of optional HPA replica fields here; set this default in centralized CR defaulting instead so all controllers/use-sites observe the same value.
(Based on your team's feedback about relying on centralized CR defaulting for optional pointer fields.) </comment>
<file context>
@@ -789,8 +789,12 @@ func (cr *VLCluster) AvailableStorageNodeIDs(kind vmv1beta1.ClusterComponent) []
+ if cr.Spec.VLStorage.HPA.MinReplicas != nil {
+ replicaCount = *cr.Spec.VLStorage.HPA.MinReplicas
+ } else {
+ replicaCount = 1
+ }
}
</file context>
95ddfd7 to
8f1c937
Compare
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.
fixes #2117
Summary by cubic
Fixes incorrect
-storageNodeflag generation when storage is scaled by HPA invmcluster,vlcluster, andvtcluster. Insert/select now compute storage nodes from the live replica count so routing stays correct during scaling. See #2117.Spec.*.ReplicaCount(storage, select, insert).AvailableStorageNodeIDsto a typed component and derive node count fromReplicaCountorHPA.MinReplicas(default 1), respecting maintenance filters.-storageNodeflags for insert/select from the computed storage node IDs.Written for commit 8f1c937. Summary will update on new commits. Review in cubic