HIVE-29685: Fix LLAP UI status for non-YARN deployments - #6656
Open
Manya0407 wants to merge 1 commit into
Open
Conversation
|
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.



What changes were proposed in this pull request?
1.This PR fixes the HiveServer2 LLAP status page (/llap.html, backed by GET /llap) on non-YARN deployments such as Kubernetes and Docker. Today LlapServlet delegates to LlapStatusServiceDriver, which only queries YARN for the LLAP application. On K8s/Docker, LLAP daemons register in ZooKeeper instead of YARN, so the driver returns APP_NOT_FOUND and the UI never shows running instances.
2.The main change is config-based routing in LlapStatusServiceDriver: when the deployment is detected as non-YARN (via hive.server2.tez.use.external.sessions=true, tez.am.framework.mode=STANDALONE_ZOOKEEPER, or the override hive.llapcli.status.use-registry), status is populated from the LLAP ZK registry instead of YARN. For those deployments, worker UUIDs are used as container IDs when YARN container IDs are absent. The YARN path is unchanged for classic YARN LLAP.
3.This PR also fixes runningThresholdAchieved not being set for servlet/one-shot callers by calling updateRunningThresholdAchieved() after a successful registry or YARN status lookup. LlapServlet now returns HTTP 500 when status lookup fails. On the UI side, it removes references to missing boolean PNG assets in llap.js, adds a defensive guard in json.human.js so bool icons are only rendered for valid /static/ paths, and adds cache-buster query params in llap.html. Unit tests are added in TestLlapStatus
Why are the changes needed?
On Kubernetes and Docker, LLAP does not run as a YARN application. Daemons register in ZooKeeper, but the status driver only looked up YARN and returned early with APP_NOT_FOUND before consulting the registry. That broke /llap.html for operators running LLAP on K8s/Docker — they could not see cluster state, instance counts, or daemon web URLs from HiveServer2.
The runningThresholdAchieved field was also never set for the servlet path, so the UI always showed false even when all daemons were up. The broken boolean icon beside runningThresholdAchieved is a separate pre-existing UI bug (missing PNG assets since HIVE-13467); this PR fixes that as well so the page renders cleanly.
Does this PR introduce any user-facing change?
Yes. On non-YARN LLAP deployments, /llap.html and GET /llap now report the correct state (RUNNING_ALL / RUNNING_PARTIAL instead of APP_NOT_FOUND), show live instance counts and daemon web URLs from the registry, and set runningThresholdAchieved to true when the running threshold is met. On YARN LLAP deployments, behavior is unchanged. When status lookup fails, the servlet returns HTTP 500 instead of 200 with incomplete JSON. The LLAP UI no longer shows a broken image icon before boolean fields; it displays plain true/false text instead.
Before :

After:

How was this patch tested?
1.Unit tests were added in TestLlapStatusRegistryFallback.java covering registry instance creation (worker identity vs YARN container ID), state updates from instance counts, config-based detection of registry vs YARN status lookup, and runningThresholdAchieved logic. These were run with mvn test -pl llap-server -Dtest=TestLlapStatusRegistryFallback.
2.End-to-end testing used the Docker LLAP stack in packaging/src/docker/ with ./start-hive.sh --llap and a locally built apache/hive:4.3.0-SNAPSHOT image