JiaLiangC opened a new pull request, #4284:
URL: https://github.com/apache/ambari/pull/4284

   ## What changes were proposed in this pull request?
   
   **Disabling Kerberos can fail at two successive steps:** the backend sends 
STOP to `ZOOKEEPER_CLIENT`, whose script has no stop method; after disabling 
succeeds, BIGTOP Hive rejects the ZooKeeper principal that the disable workflow 
legitimately cleared, so HCatalog/Hive cannot configure in plain mode.
   
   This patch lets the disable workflow stop ZooKeeper daemons and continue, 
then allows BIGTOP Hive to configure without an irrelevant Kerberos principal. 
Secure-mode principal validation remains strict.
   
   The two topic commits address one managed disable/restart workflow:
   
   - Filter client components from `addStopZookeeperStage()`. Preserve server 
STOP targets and legitimate client DISABLE_SECURITY hooks. The extended Java 
fixture includes a server and a strict client mock, then verifies the generated 
STOP component and host.
   - Resolve Hive's ZooKeeper service user according to the security mode. 
Accept the cleared value outside Kerberos; retain valid custom service names 
and reject unsafe/empty names when Kerberos is enabled. Three Python 
regressions cover these cases.
   
   Issue: [AMBARI-26691](https://issues.apache.org/jira/browse/AMBARI-26691).
   
   ### Reproduction and before/after
   
   1. Use a Kerberos-enabled cluster with both ZooKeeper Server and Client 
placements.
   2. Follow the disable wizard ordering: start ZooKeeper, stop the other 
services, then disable Kerberos.
   3. Before the patch, client STOP tasks fail with `Error: stop method isn't 
implemented` and abort later stages.
   4. With the STOP correction, disable completes, but starting BIGTOP Hive 
previously failed importing params with `ZooKeeper Kerberos service name 
contains unsafe characters` because the principal is now empty.
   
   In the native BIGTOP 3.3.0 test, request40 failed client tasks316/318/320. 
After filtering clients, request43 completed **33/33**; persisted task metadata 
shows the retained client operation is DISABLE_SECURITY. Request44 then failed 
three HCAT imports; after the Hive correction, request46 completed **38/38**. 
No failed tasks were ignored or marked successful manually.
   
   ## How was this patch tested?
   
   On the standalone branch based on upstream trunk:
   
   ```bash
   
PYTHONPATH=ambari-common/src/main/python:ambari-common/src/test/python:ambari-server/src/main/resources/stacks:ambari-server/src/test/python
 \
     python3 -m unittest -q TestHiveConfigurationBigtop TestHiveChecksBigtop
   
   mvn -B -pl ambari-server \
     -Dtest=KerberosHelperTest#testDisableKerberos \
     -DskipTests=false -DskipSurefireTests=false -DskipPythonTests=true 
-Drat.skip=true test
   
   uvx ruff check \
     
ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HIVE/package/scripts/params.py
 \
     ambari-server/src/test/python/TestHiveConfigurationBigtop.py
   
   mvn -B -DskipTests apache-rat:check
   ```
   
   **34 isolated Python tests passed; the focused Java test passed; Checkstyle 
has zero violations; Ruff and complete RAT passed.** Reactor snapshots were 
prepared with the normal Maven install lifecycle with tests/UI compilation 
skipped. Local Maven commands used the existing dependency cache and a local 
mirror/proxy settings file. The exact isolated source hashes and Surefire 
counts are in the evidence archive.
   
   Runtime verification used Maven-built Server/Agent directory assemblies on 
the existing Rocky 8 / BIGTOP 3.3.0 deployment, combined with the six previous 
installation/security PRs. Both source files and tests match this standalone PR 
byte-for-byte. No RPM was rebuilt. Results include 8 plain and 12 Kerberos 
HDFS/Hive cases, 18 exact native audit matches, anonymous WebHDFS 
401/Negotiate, rejected Hive PLAIN SASL, and successful ordinary ticket-cache 
clients. Both security modes keep three NodeManagers supervised without manual 
recovery bootstrap. Final state: three HEALTHY hosts, 20 STARTED + 24 INSTALLED 
components, zero stale configs and active requests.
   
   **[Immutable before/after evidence, artifact hashes, native JSON, operator 
findings, and four genuine UI 
captures](https://github.com/JiaLiangC/ambari/blob/1a5dbb59b9ef57ab6670a4d3514dcabda2fb5cd5/validation/compiled-six-pr-20261204/README.md).**
   
   ![Three healthy test 
hosts](https://raw.githubusercontent.com/JiaLiangC/ambari/1a5dbb59b9ef57ab6670a4d3514dcabda2fb5cd5/validation/compiled-six-pr-20261204/screenshots/compiled-cluster-hosts.png)
   
   ![Managed Kerberos enabled after 
regression](https://raw.githubusercontent.com/JiaLiangC/ambari/1a5dbb59b9ef57ab6670a4d3514dcabda2fb5cd5/validation/compiled-six-pr-20261204/screenshots/compiled-kerberos-enabled.png)
   
   Qualifications: actual uploaded Ranger binaries are **2.4.0**, while the 
stack advertises 2.6.0. A full 3.6.0 runtime rerun is not claimed. Seven real 
capacity CRITICAL alerts remain; the existing Ranger password check 
intentionally returns UNKNOWN under Kerberos, while manual configured-password 
200/invalid-password 401 checks passed. The preserved UI shows descriptor 
templates in some principal fields; native ticket/API records establish the 
actual realm. Full raw diagnostics, including an embedded HBase startup 
observation recovered by a normal retry, remain in the archive.
   
   Please review [Ambari Contributing 
Guide](https://cwiki.apache.org/confluence/display/AMBARI/How+to+Contribute) 
before opening a pull request.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to