Revert "HBASE-21323 Should not skip force updating for a sub procedure even if"

This reverts commit 30727764a3.

Revert till we figure why behavior between 2.1 and 2.2 is different.
This commit is contained in:
Michael Stack 2018-10-18 20:03:57 -07:00
parent 1afedc608e
commit 8fd3fd0e9c
No known key found for this signature in database
GPG Key ID: 9816C7FC8ACC93D2
1 changed files with 4 additions and 7 deletions

View File

@ -24,8 +24,6 @@ import java.io.IOException;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.concurrent.Exchanger; import java.util.concurrent.Exchanger;
import java.util.stream.Collectors;
import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseClassTestRule;
import org.apache.hadoop.hbase.HBaseCommonTestingUtility; import org.apache.hadoop.hbase.HBaseCommonTestingUtility;
@ -211,7 +209,7 @@ public class TestForceUpdateProcedure {
EXEC.submitProcedure(new ParentProcedure()); EXEC.submitProcedure(new ParentProcedure());
EXCHANGER.exchange(Boolean.TRUE); EXCHANGER.exchange(Boolean.TRUE);
UTIL.waitFor(10000, () -> EXEC.getActiveExecutorCount() == 0); UTIL.waitFor(10000, () -> EXEC.getActiveExecutorCount() == 0);
// The above operations are to make sure that we have persisted the states of the two // The above operations are used to make sure that we have persist the states of the two
// procedures. // procedures.
long procId = EXEC.submitProcedure(new ExchangeProcedure()); long procId = EXEC.submitProcedure(new ExchangeProcedure());
assertEquals(1, STORE.getActiveLogs().size()); assertEquals(1, STORE.getActiveLogs().size());
@ -238,13 +236,12 @@ public class TestForceUpdateProcedure {
Map<Class<?>, Procedure<Void>> procMap = new HashMap<>(); Map<Class<?>, Procedure<Void>> procMap = new HashMap<>();
EXEC.getProcedures().stream().filter(p -> !p.isFinished()) EXEC.getProcedures().stream().filter(p -> !p.isFinished())
.forEach(p -> procMap.put(p.getClass(), p)); .forEach(p -> procMap.put(p.getClass(), p));
StringBuffer sb = new StringBuffer(); assertEquals(3, procMap.size());
String mapAsStr = procMap.entrySet().stream().map(e -> e.getKey() + " " + e.getValue()).
collect(Collectors.joining(", "));
assertEquals(mapAsStr, 2, procMap.size());
ParentProcedure parentProc = (ParentProcedure) procMap.get(ParentProcedure.class); ParentProcedure parentProc = (ParentProcedure) procMap.get(ParentProcedure.class);
assertEquals(ProcedureState.WAITING, parentProc.getState()); assertEquals(ProcedureState.WAITING, parentProc.getState());
WaitingProcedure waitingProc = (WaitingProcedure) procMap.get(WaitingProcedure.class); WaitingProcedure waitingProc = (WaitingProcedure) procMap.get(WaitingProcedure.class);
assertEquals(ProcedureState.WAITING_TIMEOUT, waitingProc.getState()); assertEquals(ProcedureState.WAITING_TIMEOUT, waitingProc.getState());
DummyProcedure dummyProc = (DummyProcedure) procMap.get(DummyProcedure.class);
assertEquals(ProcedureState.SUCCESS, dummyProc.getState());
} }
} }