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

   ## What changes were proposed in this pull request?
   
   [AMBARI-26674](https://issues.apache.org/jira/browse/AMBARI-26674) adds 
**HDFS → Service Actions → Switch Active NameNode** for the BIGTOP HDFS stack. 
An operator selects a reported Standby and explicitly confirms the planned 
switch. Ambari sends a custom command to the reviewed Active and shows 
progress/errors in its standard background operations.
   
   The backend validates the configured nameservice and host identities, checks 
local configuration against the request, rechecks live roles and source/target 
health, then issues one coordinated `hdfs haadmin -failover`. Success requires 
the selected target to be Active and every other configured NameNode to be 
Standby. Before/after roles are included in structured task output. The UI 
checks authorization, running NN/ZKFC components, stale configurations, target 
selection and confirmation.
   
   Kerberos uses an isolated temporary cache. A lock rejects duplicate 
operations on the source agent; it is not a distributed lock. No force 
transitions, automatic mutation retries or automatic reverse failover are 
introduced. Following an error or timeout, operators must inspect live roles 
before retrying.
   
   This PR targets **branch-3.0.0**, matching the tested Ambari version and 
Ember UI. It supports an existing two- or three-NameNode automatic-HA topology 
and preserves stack cardinality. It includes the small hostname-to-NameNode 
resolver it needs; third-NameNode provisioning and the current trunk frontend 
migration are outside this change. The three commits separate backend, UI, and 
documentation/screenshot.
   
   ## How was this patch tested?
   
   - UI checked on the test cluster, including target selection and the 
confirmation checkbox. The operator also confirmed successful manual testing of 
role switching on that cluster.
   - 
`PYTHONPATH=ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/package/scripts:ambari-common/src/main/python
 python3 dev-support/nn-role-switch/test_role_switch.py` — **20 tests passed** 
using Python 3.9. This includes role/configuration drift, unhealthy nodes, 
duplicate operations, timeout/error handling, no repeated mutation, and 
final-role validation.
   - `node ambari-web/test/standalone/namenode_role_switch_test.js` — **14 
tests passed**.
   - `cd ambari-web && ./node_modules/.bin/brunch build` — **passed**, 1023 
files compiled. The existing local Ambari 3.0.0 dependency installation was 
reused.
   - `git diff 3af039bb..HEAD --check` — **passed**.
   
   Full Maven and complete legacy UI suites were not run.
   
   The supplied test-cluster screenshot has an anonymized hostname:
   
   ![Switch Active NameNode 
dialog](https://raw.githubusercontent.com/iskenderurs/ambari/AMBARI-26674/docs/images/namenode-role-switch.png)
   
   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