HADOOP-10668. TestZKFailoverControllerStress#testExpireBackAndForth occasionally fails. Contributed by Ming Ma.
(cherry picked from commit 7fc1f2f5cf
)
This commit is contained in:
parent
5a00b23106
commit
0b55634b9c
|
@ -153,7 +153,9 @@ public abstract class ZKFailoverController {
|
||||||
public HAServiceTarget getLocalTarget() {
|
public HAServiceTarget getLocalTarget() {
|
||||||
return localTarget;
|
return localTarget;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HAServiceState getServiceState() { return serviceState; }
|
||||||
|
|
||||||
public int run(final String[] args) throws Exception {
|
public int run(final String[] args) throws Exception {
|
||||||
if (!localTarget.isAutoFailoverEnabled()) {
|
if (!localTarget.isAutoFailoverEnabled()) {
|
||||||
LOG.fatal("Automatic failover is not enabled for " + localTarget + "." +
|
LOG.fatal("Automatic failover is not enabled for " + localTarget + "." +
|
||||||
|
|
|
@ -163,8 +163,8 @@ public class MiniZKFCCluster {
|
||||||
*/
|
*/
|
||||||
public void waitForHAState(int idx, HAServiceState state)
|
public void waitForHAState(int idx, HAServiceState state)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
DummyHAService svc = getService(idx);
|
DummyZKFC svc = getZkfc(idx);
|
||||||
while (svc.state != state) {
|
while (svc.getServiceState() != state) {
|
||||||
ctx.checkException();
|
ctx.checkException();
|
||||||
Thread.sleep(50);
|
Thread.sleep(50);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue