File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed
hadoop-yarn/hadoop-yarn-client/src
main/java/org/apache/hadoop/yarn/client/cli
test/java/org/apache/hadoop/yarn/client/cli Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -565,6 +565,9 @@ Release 2.8.0 - UNRELEASED
565565 YARN-3859. LeafQueue doesn't print user properly for application add.
566566 (Varun Saxena via devaraj)
567567
568+ YARN-3860. rmadmin -transitionToActive should check the state of non-target node.
569+ (Masatake Iwasaki via junping_du)
570+
568571Release 2.7.2 - UNRELEASED
569572
570573 INCOMPATIBLE CHANGES
Original file line number Diff line number Diff line change @@ -797,7 +797,15 @@ protected HAServiceTarget resolveTarget(String rmId) {
797797 "Could not connect to RM HA Admin for node " + rmId );
798798 }
799799 }
800-
800+
801+ /**
802+ * returns the list of all resourcemanager ids for the given configuration.
803+ */
804+ @ Override
805+ protected Collection <String > getTargetIds (String targetNodeToActivate ) {
806+ return HAUtil .getRMHAIds (getConf ());
807+ }
808+
801809 @ Override
802810 protected String getUsageString () {
803811 return "Usage: rmadmin" ;
Original file line number Diff line number Diff line change 2727import static org .mockito .Matchers .eq ;
2828import static org .mockito .Mockito .mock ;
2929import static org .mockito .Mockito .never ;
30+ import static org .mockito .Mockito .times ;
3031import static org .mockito .Mockito .verify ;
3132import static org .mockito .Mockito .when ;
3233
@@ -116,6 +117,7 @@ protected HAServiceTarget resolveTarget(String rmId) {
116117
117118 YarnConfiguration conf = new YarnConfiguration ();
118119 conf .setBoolean (YarnConfiguration .RM_HA_ENABLED , true );
120+ conf .set (YarnConfiguration .RM_HA_IDS , "rm1,rm2" );
119121 rmAdminCLIWithHAEnabled = new RMAdminCLI (conf ) {
120122
121123 @ Override
@@ -259,6 +261,8 @@ public void testTransitionToActive() throws Exception {
259261 assertEquals (0 , rmAdminCLIWithHAEnabled .run (args ));
260262 verify (haadmin ).transitionToActive (
261263 any (HAServiceProtocol .StateChangeRequestInfo .class ));
264+ // HAAdmin#isOtherTargetNodeActive should check state of non-target node.
265+ verify (haadmin , times (1 )).getServiceStatus ();
262266 }
263267
264268 @ Test (timeout = 500 )
You can’t perform that action at this time.
0 commit comments