YARN-10260. Allow transitioning queue from DRAINING to RUNNING state. Contributed by Bilwa S T
(cherry picked from commit fff1d2c1226ec23841b04dd478e8b97f31abbeba) (cherry picked from commit 564d3211f27c35bf3143a4bd1b3f8eeac2c6b01f) (cherry picked from commit a7ea55e0156299ec8b80af1f3e681a3a7a31a3b4) (cherry picked from commit b3e9aff5f7bcafea8b82f9b07719ff53d3ab2f12)
This commit is contained in:
parent
d0b0fb6e04
commit
b8c88f6968
@ -1092,10 +1092,6 @@ public void activeQueue() throws YarnException {
|
||||
if (getState() == QueueState.RUNNING) {
|
||||
LOG.info("The specified queue:" + queueName
|
||||
+ " is already in the RUNNING state.");
|
||||
} else if (getState() == QueueState.DRAINING) {
|
||||
throw new YarnException(
|
||||
"The queue:" + queueName + " is in the Stopping process. "
|
||||
+ "Please wait for the queue getting fully STOPPED.");
|
||||
} else {
|
||||
CSQueue parent = getParent();
|
||||
if (parent == null || parent.getState() == QueueState.RUNNING) {
|
||||
|
@ -151,6 +151,23 @@ public void testQueueStateTransit() throws Exception {
|
||||
Assert.assertEquals(QueueState.DRAINING, cs.getQueue(Q2).getState());
|
||||
Assert.assertEquals(QueueState.RUNNING, cs.getQueue(Q3).getState());
|
||||
|
||||
// set Q2 state to RUNNING and do reinitialize.
|
||||
// Q2 should transit from DRAINING to RUNNING
|
||||
csConf.setState(Q2_PATH, QueueState.RUNNING);
|
||||
conf = new YarnConfiguration(csConf);
|
||||
cs.reinitialize(conf, rmContext);
|
||||
Assert.assertEquals(QueueState.RUNNING, cs.getQueue(Q1).getState());
|
||||
Assert.assertEquals(QueueState.RUNNING, cs.getQueue(Q2).getState());
|
||||
Assert.assertEquals(QueueState.RUNNING, cs.getQueue(Q3).getState());
|
||||
|
||||
// set Q2 state to stop and do reinitialize.
|
||||
csConf.setState(Q2_PATH, QueueState.STOPPED);
|
||||
conf = new YarnConfiguration(csConf);
|
||||
cs.reinitialize(conf, rmContext);
|
||||
Assert.assertEquals(QueueState.RUNNING, cs.getQueue(Q1).getState());
|
||||
Assert.assertEquals(QueueState.DRAINING, cs.getQueue(Q2).getState());
|
||||
Assert.assertEquals(QueueState.RUNNING, cs.getQueue(Q3).getState());
|
||||
|
||||
// set Q1 state to stop and do reinitialize.
|
||||
csConf.setState(Q1_PATH, QueueState.STOPPED);
|
||||
conf = new YarnConfiguration(csConf);
|
||||
|
Loading…
x
Reference in New Issue
Block a user