HBASE-17186 MasterProcedureTestingUtility#testRecoveryAndDoubleExecution displays stale procedure state info (Stephen Yuan Jiang)
This commit is contained in:
parent
51d9bac42b
commit
b2d3fa1a8a
|
@ -329,7 +329,6 @@ public class MasterProcedureTestingUtility {
|
||||||
private static void testRecoveryAndDoubleExecution(
|
private static void testRecoveryAndDoubleExecution(
|
||||||
final ProcedureExecutor<MasterProcedureEnv> procExec, final long procId,
|
final ProcedureExecutor<MasterProcedureEnv> procExec, final long procId,
|
||||||
final int numSteps, final boolean expectExecRunning) throws Exception {
|
final int numSteps, final boolean expectExecRunning) throws Exception {
|
||||||
final Procedure proc = procExec.getProcedure(procId);
|
|
||||||
ProcedureTestingUtility.waitProcedure(procExec, procId);
|
ProcedureTestingUtility.waitProcedure(procExec, procId);
|
||||||
assertEquals(false, procExec.isRunning());
|
assertEquals(false, procExec.isRunning());
|
||||||
|
|
||||||
|
@ -338,7 +337,7 @@ public class MasterProcedureTestingUtility {
|
||||||
// restart executor/store
|
// restart executor/store
|
||||||
// execute step N - save on store
|
// execute step N - save on store
|
||||||
for (int i = 0; i < numSteps; ++i) {
|
for (int i = 0; i < numSteps; ++i) {
|
||||||
LOG.info("Restart " + i + " exec state: " + proc);
|
LOG.info("Restart " + i + " exec state: " + procExec.getProcedure(procId));
|
||||||
ProcedureTestingUtility.assertProcNotYetCompleted(procExec, procId);
|
ProcedureTestingUtility.assertProcNotYetCompleted(procExec, procId);
|
||||||
ProcedureTestingUtility.restart(procExec);
|
ProcedureTestingUtility.restart(procExec);
|
||||||
ProcedureTestingUtility.waitProcedure(procExec, procId);
|
ProcedureTestingUtility.waitProcedure(procExec, procId);
|
||||||
|
@ -365,11 +364,10 @@ public class MasterProcedureTestingUtility {
|
||||||
*/
|
*/
|
||||||
public static void testRecoveryAndDoubleExecution(
|
public static void testRecoveryAndDoubleExecution(
|
||||||
final ProcedureExecutor<MasterProcedureEnv> procExec, final long procId) throws Exception {
|
final ProcedureExecutor<MasterProcedureEnv> procExec, final long procId) throws Exception {
|
||||||
final Procedure proc = procExec.getProcedure(procId);
|
|
||||||
ProcedureTestingUtility.waitProcedure(procExec, procId);
|
ProcedureTestingUtility.waitProcedure(procExec, procId);
|
||||||
assertEquals(false, procExec.isRunning());
|
assertEquals(false, procExec.isRunning());
|
||||||
for (int i = 0; !procExec.isFinished(procId); ++i) {
|
for (int i = 0; !procExec.isFinished(procId); ++i) {
|
||||||
LOG.info("Restart " + i + " exec state: " + proc);
|
LOG.info("Restart " + i + " exec state: " + procExec.getProcedure(procId));
|
||||||
ProcedureTestingUtility.restart(procExec);
|
ProcedureTestingUtility.restart(procExec);
|
||||||
ProcedureTestingUtility.waitProcedure(procExec, procId);
|
ProcedureTestingUtility.waitProcedure(procExec, procId);
|
||||||
}
|
}
|
||||||
|
@ -388,8 +386,6 @@ public class MasterProcedureTestingUtility {
|
||||||
public static void testRollbackAndDoubleExecution(
|
public static void testRollbackAndDoubleExecution(
|
||||||
final ProcedureExecutor<MasterProcedureEnv> procExec, final long procId,
|
final ProcedureExecutor<MasterProcedureEnv> procExec, final long procId,
|
||||||
final int lastStep) throws Exception {
|
final int lastStep) throws Exception {
|
||||||
final Procedure proc = procExec.getProcedure(procId);
|
|
||||||
|
|
||||||
// Execute up to last step
|
// Execute up to last step
|
||||||
testRecoveryAndDoubleExecution(procExec, procId, lastStep, false);
|
testRecoveryAndDoubleExecution(procExec, procId, lastStep, false);
|
||||||
|
|
||||||
|
@ -402,7 +398,7 @@ public class MasterProcedureTestingUtility {
|
||||||
procExec.registerListener(abortListener);
|
procExec.registerListener(abortListener);
|
||||||
try {
|
try {
|
||||||
for (int i = 0; !procExec.isFinished(procId); ++i) {
|
for (int i = 0; !procExec.isFinished(procId); ++i) {
|
||||||
LOG.info("Restart " + i + " rollback state: " + proc);
|
LOG.info("Restart " + i + " rollback state: " + procExec.getProcedure(procId));
|
||||||
ProcedureTestingUtility.assertProcNotYetCompleted(procExec, procId);
|
ProcedureTestingUtility.assertProcNotYetCompleted(procExec, procId);
|
||||||
ProcedureTestingUtility.restart(procExec);
|
ProcedureTestingUtility.restart(procExec);
|
||||||
ProcedureTestingUtility.waitProcedure(procExec, procId);
|
ProcedureTestingUtility.waitProcedure(procExec, procId);
|
||||||
|
|
Loading…
Reference in New Issue