Skip to content

HIVE-30091: Fix K8s operator LLAP/TezAM replica resolution when autos… - #6814

Merged
ayushtkn merged 3 commits into
apache:masterfrom
tanishq-chugh:spec-replicas
Sep 24, 2026
Merged

ayushtkn merged 3 commits into
apache:masterfrom
tanishq-chugh:spec-replicas

Conversation

@tanishq-chugh

@tanishq-chugh tanishq-chugh commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

…caling is disabled

What changes were proposed in this pull request?

Clean up stale autoscaling state per-component when autoscaling has been disabled

Why are the changes needed?

To Fix the case where suspend/wake and toggling autoscaling off caused wrong replica state

Does this PR introduce any user-facing change?

No

How was this patch tested?

Manual Testing

@tanishq-chugh

Copy link
Copy Markdown
Contributor Author

CC: @ayushtkn

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

One or more issues must be addressed before approval.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Updates the Kubernetes operator’s replica resolution so static replica settings are honored when autoscaling is disabled.

Changes:

  • Cleans managed replica values for non-autoscaled components.
  • Limits wake-up state initialization to autoscaled components.
  • Adds managed-replica cleanup support.
File Description
packaging/​src/​kubernetes/​src/​java/​org/​apache/​hive/​kubernetes/​operator/​reconciler/​HiveClusterReconciler.java Updated as part of this pull request.
packaging/​src/​kubernetes/​src/​java/​org/​apache/​hive/​kubernetes/​operator/​dependent/​HiveDependentResource.java Updated as part of this pull request.
packaging/​src/​kubernetes/​src/​java/​org/​apache/​hive/​kubernetes/​operator/​autoscaling/​HiveClusterAutoscaler.java Updated as part of this pull request.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +88 to +89
public static void cleanupManagedReplicas(String namespace, String clusterName, String component) {
MANAGED_REPLICAS.remove(cacheKey(namespace, clusterName, component));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in commit: 8d08f2a

}
}

private static void resetComponentAutoscalingState(HiveClusterAutoscaler scaler,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider renaming to clearAutoscalingState, not to shadow the instance method it calls

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed in commit: 4a0cafe

@tanishq-chugh tanishq-chugh changed the title [WIP] HIVE-30091: Fix K8s operator LLAP/TezAM replica resolution when autos… HIVE-30091: Fix K8s operator LLAP/TezAM replica resolution when autos… Sep 23, 2026
@sonarqubecloud

Copy link
Copy Markdown

@ayushtkn
ayushtkn merged commit 6d4ff6d into apache:master Sep 24, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants