hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [01/30] hbase-site git commit: Published site at 931156f66b1decc19d89f8bb3ce9e5f355fb4fb2.
Date Mon, 22 Oct 2018 14:53:39 GMT
Repository: hbase-site
Updated Branches:
  refs/heads/asf-site 39b82c864 -> 6b8b907fe


http://git-wip-us.apache.org/repos/asf/hbase-site/blob/6b8b907f/testdevapidocs/src-html/org/apache/hadoop/hbase/master/procedure/MasterProcedureTestingUtility.InjectAbortOnLoadListener.html
----------------------------------------------------------------------
diff --git a/testdevapidocs/src-html/org/apache/hadoop/hbase/master/procedure/MasterProcedureTestingUtility.InjectAbortOnLoadListener.html b/testdevapidocs/src-html/org/apache/hadoop/hbase/master/procedure/MasterProcedureTestingUtility.InjectAbortOnLoadListener.html
index 0c87f49..e276e13 100644
--- a/testdevapidocs/src-html/org/apache/hadoop/hbase/master/procedure/MasterProcedureTestingUtility.InjectAbortOnLoadListener.html
+++ b/testdevapidocs/src-html/org/apache/hadoop/hbase/master/procedure/MasterProcedureTestingUtility.InjectAbortOnLoadListener.html
@@ -518,91 +518,96 @@
 <span class="sourceLineNo">510</span>      // Sometimes there are other procedures still executing (including asynchronously spawned by<a name="line.510"></a>
 <span class="sourceLineNo">511</span>      // procId) and due to KillAndToggleBeforeStoreUpdate flag ProcedureExecutor is stopped before<a name="line.511"></a>
 <span class="sourceLineNo">512</span>      // store update. Let all pending procedures finish normally.<a name="line.512"></a>
-<span class="sourceLineNo">513</span>      if (!procExec.isRunning()) {<a name="line.513"></a>
-<span class="sourceLineNo">514</span>        LOG.warn("ProcedureExecutor not running, may have been stopped by pending procedure due to"<a name="line.514"></a>
-<span class="sourceLineNo">515</span>            + " KillAndToggleBeforeStoreUpdate flag.");<a name="line.515"></a>
-<span class="sourceLineNo">516</span>        ProcedureTestingUtility.setKillAndToggleBeforeStoreUpdate(procExec, false);<a name="line.516"></a>
-<span class="sourceLineNo">517</span>        restartMasterProcedureExecutor(procExec);<a name="line.517"></a>
-<span class="sourceLineNo">518</span>        ProcedureTestingUtility.waitNoProcedureRunning(procExec);<a name="line.518"></a>
-<span class="sourceLineNo">519</span>      }<a name="line.519"></a>
-<span class="sourceLineNo">520</span>    }<a name="line.520"></a>
-<span class="sourceLineNo">521</span><a name="line.521"></a>
-<span class="sourceLineNo">522</span>    assertEquals(true, procExec.isRunning());<a name="line.522"></a>
-<span class="sourceLineNo">523</span>    ProcedureTestingUtility.assertIsAbortException(procExec.getResult(procId));<a name="line.523"></a>
-<span class="sourceLineNo">524</span>  }<a name="line.524"></a>
-<span class="sourceLineNo">525</span><a name="line.525"></a>
-<span class="sourceLineNo">526</span>  /**<a name="line.526"></a>
-<span class="sourceLineNo">527</span>   * Execute the procedure up to "lastStep" and then the ProcedureExecutor<a name="line.527"></a>
-<span class="sourceLineNo">528</span>   * is restarted and an abort() is injected.<a name="line.528"></a>
-<span class="sourceLineNo">529</span>   * If the procedure implement abort() this should result in rollback being triggered.<a name="line.529"></a>
-<span class="sourceLineNo">530</span>   * At the end of this call the procedure should be finished and rolledback.<a name="line.530"></a>
-<span class="sourceLineNo">531</span>   * This method assert on the procedure being terminated with an AbortException.<a name="line.531"></a>
-<span class="sourceLineNo">532</span>   */<a name="line.532"></a>
-<span class="sourceLineNo">533</span>  public static void testRollbackRetriableFailure(<a name="line.533"></a>
-<span class="sourceLineNo">534</span>      final ProcedureExecutor&lt;MasterProcedureEnv&gt; procExec, final long procId,<a name="line.534"></a>
-<span class="sourceLineNo">535</span>      final int lastStep) throws Exception {<a name="line.535"></a>
-<span class="sourceLineNo">536</span>    // Execute up to last step<a name="line.536"></a>
-<span class="sourceLineNo">537</span>    testRecoveryAndDoubleExecution(procExec, procId, lastStep, false);<a name="line.537"></a>
-<span class="sourceLineNo">538</span><a name="line.538"></a>
-<span class="sourceLineNo">539</span>    // execute the rollback<a name="line.539"></a>
-<span class="sourceLineNo">540</span>    testRestartWithAbort(procExec, procId);<a name="line.540"></a>
-<span class="sourceLineNo">541</span><a name="line.541"></a>
-<span class="sourceLineNo">542</span>    assertEquals(true, procExec.isRunning());<a name="line.542"></a>
-<span class="sourceLineNo">543</span>    ProcedureTestingUtility.assertIsAbortException(procExec.getResult(procId));<a name="line.543"></a>
-<span class="sourceLineNo">544</span>  }<a name="line.544"></a>
-<span class="sourceLineNo">545</span><a name="line.545"></a>
-<span class="sourceLineNo">546</span>  /**<a name="line.546"></a>
-<span class="sourceLineNo">547</span>   * Restart the ProcedureExecutor and inject an abort to the specified procedure.<a name="line.547"></a>
-<span class="sourceLineNo">548</span>   * If the procedure implement abort() this should result in rollback being triggered.<a name="line.548"></a>
-<span class="sourceLineNo">549</span>   * At the end of this call the procedure should be finished and rolledback, if abort is implemnted<a name="line.549"></a>
-<span class="sourceLineNo">550</span>   */<a name="line.550"></a>
-<span class="sourceLineNo">551</span>  public static void testRestartWithAbort(ProcedureExecutor&lt;MasterProcedureEnv&gt; procExec,<a name="line.551"></a>
-<span class="sourceLineNo">552</span>      long procId) throws Exception {<a name="line.552"></a>
-<span class="sourceLineNo">553</span>    ProcedureTestingUtility.setKillAndToggleBeforeStoreUpdate(procExec, false);<a name="line.553"></a>
-<span class="sourceLineNo">554</span>    InjectAbortOnLoadListener abortListener = new InjectAbortOnLoadListener(procExec);<a name="line.554"></a>
-<span class="sourceLineNo">555</span>    abortListener.addProcId(procId);<a name="line.555"></a>
-<span class="sourceLineNo">556</span>    procExec.registerListener(abortListener);<a name="line.556"></a>
-<span class="sourceLineNo">557</span>    try {<a name="line.557"></a>
-<span class="sourceLineNo">558</span>      ProcedureTestingUtility.assertProcNotYetCompleted(procExec, procId);<a name="line.558"></a>
-<span class="sourceLineNo">559</span>      LOG.info("Restart and rollback procId=" + procId);<a name="line.559"></a>
-<span class="sourceLineNo">560</span>      restartMasterProcedureExecutor(procExec);<a name="line.560"></a>
-<span class="sourceLineNo">561</span>      ProcedureTestingUtility.waitProcedure(procExec, procId);<a name="line.561"></a>
-<span class="sourceLineNo">562</span>    } finally {<a name="line.562"></a>
-<span class="sourceLineNo">563</span>      assertTrue(procExec.unregisterListener(abortListener));<a name="line.563"></a>
-<span class="sourceLineNo">564</span>    }<a name="line.564"></a>
-<span class="sourceLineNo">565</span>  }<a name="line.565"></a>
-<span class="sourceLineNo">566</span><a name="line.566"></a>
-<span class="sourceLineNo">567</span>  public static class InjectAbortOnLoadListener<a name="line.567"></a>
-<span class="sourceLineNo">568</span>      implements ProcedureExecutor.ProcedureExecutorListener {<a name="line.568"></a>
-<span class="sourceLineNo">569</span>    private final ProcedureExecutor&lt;MasterProcedureEnv&gt; procExec;<a name="line.569"></a>
-<span class="sourceLineNo">570</span>    private TreeSet&lt;Long&gt; procsToAbort = null;<a name="line.570"></a>
+<span class="sourceLineNo">513</span>      ProcedureTestingUtility.setKillAndToggleBeforeStoreUpdate(procExec, false);<a name="line.513"></a>
+<span class="sourceLineNo">514</span>      // check 3 times to confirm that the procedure executor has not been killed<a name="line.514"></a>
+<span class="sourceLineNo">515</span>      for (int i = 0; i &lt; 3; i++) {<a name="line.515"></a>
+<span class="sourceLineNo">516</span>        if (!procExec.isRunning()) {<a name="line.516"></a>
+<span class="sourceLineNo">517</span>          LOG.warn("ProcedureExecutor not running, may have been stopped by pending procedure due" +<a name="line.517"></a>
+<span class="sourceLineNo">518</span>            " to KillAndToggleBeforeStoreUpdate flag.");<a name="line.518"></a>
+<span class="sourceLineNo">519</span>          restartMasterProcedureExecutor(procExec);<a name="line.519"></a>
+<span class="sourceLineNo">520</span>          break;<a name="line.520"></a>
+<span class="sourceLineNo">521</span>        }<a name="line.521"></a>
+<span class="sourceLineNo">522</span>        Thread.sleep(1000);<a name="line.522"></a>
+<span class="sourceLineNo">523</span>      }<a name="line.523"></a>
+<span class="sourceLineNo">524</span>      ProcedureTestingUtility.waitNoProcedureRunning(procExec);<a name="line.524"></a>
+<span class="sourceLineNo">525</span>    }<a name="line.525"></a>
+<span class="sourceLineNo">526</span><a name="line.526"></a>
+<span class="sourceLineNo">527</span>    assertEquals(true, procExec.isRunning());<a name="line.527"></a>
+<span class="sourceLineNo">528</span>    ProcedureTestingUtility.assertIsAbortException(procExec.getResult(procId));<a name="line.528"></a>
+<span class="sourceLineNo">529</span>  }<a name="line.529"></a>
+<span class="sourceLineNo">530</span><a name="line.530"></a>
+<span class="sourceLineNo">531</span>  /**<a name="line.531"></a>
+<span class="sourceLineNo">532</span>   * Execute the procedure up to "lastStep" and then the ProcedureExecutor<a name="line.532"></a>
+<span class="sourceLineNo">533</span>   * is restarted and an abort() is injected.<a name="line.533"></a>
+<span class="sourceLineNo">534</span>   * If the procedure implement abort() this should result in rollback being triggered.<a name="line.534"></a>
+<span class="sourceLineNo">535</span>   * At the end of this call the procedure should be finished and rolledback.<a name="line.535"></a>
+<span class="sourceLineNo">536</span>   * This method assert on the procedure being terminated with an AbortException.<a name="line.536"></a>
+<span class="sourceLineNo">537</span>   */<a name="line.537"></a>
+<span class="sourceLineNo">538</span>  public static void testRollbackRetriableFailure(<a name="line.538"></a>
+<span class="sourceLineNo">539</span>      final ProcedureExecutor&lt;MasterProcedureEnv&gt; procExec, final long procId,<a name="line.539"></a>
+<span class="sourceLineNo">540</span>      final int lastStep) throws Exception {<a name="line.540"></a>
+<span class="sourceLineNo">541</span>    // Execute up to last step<a name="line.541"></a>
+<span class="sourceLineNo">542</span>    testRecoveryAndDoubleExecution(procExec, procId, lastStep, false);<a name="line.542"></a>
+<span class="sourceLineNo">543</span><a name="line.543"></a>
+<span class="sourceLineNo">544</span>    // execute the rollback<a name="line.544"></a>
+<span class="sourceLineNo">545</span>    testRestartWithAbort(procExec, procId);<a name="line.545"></a>
+<span class="sourceLineNo">546</span><a name="line.546"></a>
+<span class="sourceLineNo">547</span>    assertEquals(true, procExec.isRunning());<a name="line.547"></a>
+<span class="sourceLineNo">548</span>    ProcedureTestingUtility.assertIsAbortException(procExec.getResult(procId));<a name="line.548"></a>
+<span class="sourceLineNo">549</span>  }<a name="line.549"></a>
+<span class="sourceLineNo">550</span><a name="line.550"></a>
+<span class="sourceLineNo">551</span>  /**<a name="line.551"></a>
+<span class="sourceLineNo">552</span>   * Restart the ProcedureExecutor and inject an abort to the specified procedure.<a name="line.552"></a>
+<span class="sourceLineNo">553</span>   * If the procedure implement abort() this should result in rollback being triggered.<a name="line.553"></a>
+<span class="sourceLineNo">554</span>   * At the end of this call the procedure should be finished and rolledback, if abort is implemnted<a name="line.554"></a>
+<span class="sourceLineNo">555</span>   */<a name="line.555"></a>
+<span class="sourceLineNo">556</span>  public static void testRestartWithAbort(ProcedureExecutor&lt;MasterProcedureEnv&gt; procExec,<a name="line.556"></a>
+<span class="sourceLineNo">557</span>      long procId) throws Exception {<a name="line.557"></a>
+<span class="sourceLineNo">558</span>    ProcedureTestingUtility.setKillAndToggleBeforeStoreUpdate(procExec, false);<a name="line.558"></a>
+<span class="sourceLineNo">559</span>    InjectAbortOnLoadListener abortListener = new InjectAbortOnLoadListener(procExec);<a name="line.559"></a>
+<span class="sourceLineNo">560</span>    abortListener.addProcId(procId);<a name="line.560"></a>
+<span class="sourceLineNo">561</span>    procExec.registerListener(abortListener);<a name="line.561"></a>
+<span class="sourceLineNo">562</span>    try {<a name="line.562"></a>
+<span class="sourceLineNo">563</span>      ProcedureTestingUtility.assertProcNotYetCompleted(procExec, procId);<a name="line.563"></a>
+<span class="sourceLineNo">564</span>      LOG.info("Restart and rollback procId=" + procId);<a name="line.564"></a>
+<span class="sourceLineNo">565</span>      restartMasterProcedureExecutor(procExec);<a name="line.565"></a>
+<span class="sourceLineNo">566</span>      ProcedureTestingUtility.waitProcedure(procExec, procId);<a name="line.566"></a>
+<span class="sourceLineNo">567</span>    } finally {<a name="line.567"></a>
+<span class="sourceLineNo">568</span>      assertTrue(procExec.unregisterListener(abortListener));<a name="line.568"></a>
+<span class="sourceLineNo">569</span>    }<a name="line.569"></a>
+<span class="sourceLineNo">570</span>  }<a name="line.570"></a>
 <span class="sourceLineNo">571</span><a name="line.571"></a>
-<span class="sourceLineNo">572</span>    public InjectAbortOnLoadListener(final ProcedureExecutor&lt;MasterProcedureEnv&gt; procExec) {<a name="line.572"></a>
-<span class="sourceLineNo">573</span>      this.procExec = procExec;<a name="line.573"></a>
-<span class="sourceLineNo">574</span>    }<a name="line.574"></a>
-<span class="sourceLineNo">575</span><a name="line.575"></a>
-<span class="sourceLineNo">576</span>    public void addProcId(long procId) {<a name="line.576"></a>
-<span class="sourceLineNo">577</span>      if (procsToAbort == null) {<a name="line.577"></a>
-<span class="sourceLineNo">578</span>        procsToAbort = new TreeSet&lt;&gt;();<a name="line.578"></a>
-<span class="sourceLineNo">579</span>      }<a name="line.579"></a>
-<span class="sourceLineNo">580</span>      procsToAbort.add(procId);<a name="line.580"></a>
-<span class="sourceLineNo">581</span>    }<a name="line.581"></a>
-<span class="sourceLineNo">582</span><a name="line.582"></a>
-<span class="sourceLineNo">583</span>    @Override<a name="line.583"></a>
-<span class="sourceLineNo">584</span>    public void procedureLoaded(long procId) {<a name="line.584"></a>
-<span class="sourceLineNo">585</span>      if (procsToAbort != null &amp;&amp; !procsToAbort.contains(procId)) {<a name="line.585"></a>
-<span class="sourceLineNo">586</span>        return;<a name="line.586"></a>
-<span class="sourceLineNo">587</span>      }<a name="line.587"></a>
-<span class="sourceLineNo">588</span>      procExec.abort(procId);<a name="line.588"></a>
-<span class="sourceLineNo">589</span>    }<a name="line.589"></a>
-<span class="sourceLineNo">590</span><a name="line.590"></a>
-<span class="sourceLineNo">591</span>    @Override<a name="line.591"></a>
-<span class="sourceLineNo">592</span>    public void procedureAdded(long procId) { /* no-op */ }<a name="line.592"></a>
-<span class="sourceLineNo">593</span><a name="line.593"></a>
-<span class="sourceLineNo">594</span>    @Override<a name="line.594"></a>
-<span class="sourceLineNo">595</span>    public void procedureFinished(long procId) { /* no-op */ }<a name="line.595"></a>
-<span class="sourceLineNo">596</span>  }<a name="line.596"></a>
-<span class="sourceLineNo">597</span>}<a name="line.597"></a>
+<span class="sourceLineNo">572</span>  public static class InjectAbortOnLoadListener<a name="line.572"></a>
+<span class="sourceLineNo">573</span>      implements ProcedureExecutor.ProcedureExecutorListener {<a name="line.573"></a>
+<span class="sourceLineNo">574</span>    private final ProcedureExecutor&lt;MasterProcedureEnv&gt; procExec;<a name="line.574"></a>
+<span class="sourceLineNo">575</span>    private TreeSet&lt;Long&gt; procsToAbort = null;<a name="line.575"></a>
+<span class="sourceLineNo">576</span><a name="line.576"></a>
+<span class="sourceLineNo">577</span>    public InjectAbortOnLoadListener(final ProcedureExecutor&lt;MasterProcedureEnv&gt; procExec) {<a name="line.577"></a>
+<span class="sourceLineNo">578</span>      this.procExec = procExec;<a name="line.578"></a>
+<span class="sourceLineNo">579</span>    }<a name="line.579"></a>
+<span class="sourceLineNo">580</span><a name="line.580"></a>
+<span class="sourceLineNo">581</span>    public void addProcId(long procId) {<a name="line.581"></a>
+<span class="sourceLineNo">582</span>      if (procsToAbort == null) {<a name="line.582"></a>
+<span class="sourceLineNo">583</span>        procsToAbort = new TreeSet&lt;&gt;();<a name="line.583"></a>
+<span class="sourceLineNo">584</span>      }<a name="line.584"></a>
+<span class="sourceLineNo">585</span>      procsToAbort.add(procId);<a name="line.585"></a>
+<span class="sourceLineNo">586</span>    }<a name="line.586"></a>
+<span class="sourceLineNo">587</span><a name="line.587"></a>
+<span class="sourceLineNo">588</span>    @Override<a name="line.588"></a>
+<span class="sourceLineNo">589</span>    public void procedureLoaded(long procId) {<a name="line.589"></a>
+<span class="sourceLineNo">590</span>      if (procsToAbort != null &amp;&amp; !procsToAbort.contains(procId)) {<a name="line.590"></a>
+<span class="sourceLineNo">591</span>        return;<a name="line.591"></a>
+<span class="sourceLineNo">592</span>      }<a name="line.592"></a>
+<span class="sourceLineNo">593</span>      procExec.abort(procId);<a name="line.593"></a>
+<span class="sourceLineNo">594</span>    }<a name="line.594"></a>
+<span class="sourceLineNo">595</span><a name="line.595"></a>
+<span class="sourceLineNo">596</span>    @Override<a name="line.596"></a>
+<span class="sourceLineNo">597</span>    public void procedureAdded(long procId) { /* no-op */ }<a name="line.597"></a>
+<span class="sourceLineNo">598</span><a name="line.598"></a>
+<span class="sourceLineNo">599</span>    @Override<a name="line.599"></a>
+<span class="sourceLineNo">600</span>    public void procedureFinished(long procId) { /* no-op */ }<a name="line.600"></a>
+<span class="sourceLineNo">601</span>  }<a name="line.601"></a>
+<span class="sourceLineNo">602</span>}<a name="line.602"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/6b8b907f/testdevapidocs/src-html/org/apache/hadoop/hbase/master/procedure/MasterProcedureTestingUtility.StepHook.html
----------------------------------------------------------------------
diff --git a/testdevapidocs/src-html/org/apache/hadoop/hbase/master/procedure/MasterProcedureTestingUtility.StepHook.html b/testdevapidocs/src-html/org/apache/hadoop/hbase/master/procedure/MasterProcedureTestingUtility.StepHook.html
index 0c87f49..e276e13 100644
--- a/testdevapidocs/src-html/org/apache/hadoop/hbase/master/procedure/MasterProcedureTestingUtility.StepHook.html
+++ b/testdevapidocs/src-html/org/apache/hadoop/hbase/master/procedure/MasterProcedureTestingUtility.StepHook.html
@@ -518,91 +518,96 @@
 <span class="sourceLineNo">510</span>      // Sometimes there are other procedures still executing (including asynchronously spawned by<a name="line.510"></a>
 <span class="sourceLineNo">511</span>      // procId) and due to KillAndToggleBeforeStoreUpdate flag ProcedureExecutor is stopped before<a name="line.511"></a>
 <span class="sourceLineNo">512</span>      // store update. Let all pending procedures finish normally.<a name="line.512"></a>
-<span class="sourceLineNo">513</span>      if (!procExec.isRunning()) {<a name="line.513"></a>
-<span class="sourceLineNo">514</span>        LOG.warn("ProcedureExecutor not running, may have been stopped by pending procedure due to"<a name="line.514"></a>
-<span class="sourceLineNo">515</span>            + " KillAndToggleBeforeStoreUpdate flag.");<a name="line.515"></a>
-<span class="sourceLineNo">516</span>        ProcedureTestingUtility.setKillAndToggleBeforeStoreUpdate(procExec, false);<a name="line.516"></a>
-<span class="sourceLineNo">517</span>        restartMasterProcedureExecutor(procExec);<a name="line.517"></a>
-<span class="sourceLineNo">518</span>        ProcedureTestingUtility.waitNoProcedureRunning(procExec);<a name="line.518"></a>
-<span class="sourceLineNo">519</span>      }<a name="line.519"></a>
-<span class="sourceLineNo">520</span>    }<a name="line.520"></a>
-<span class="sourceLineNo">521</span><a name="line.521"></a>
-<span class="sourceLineNo">522</span>    assertEquals(true, procExec.isRunning());<a name="line.522"></a>
-<span class="sourceLineNo">523</span>    ProcedureTestingUtility.assertIsAbortException(procExec.getResult(procId));<a name="line.523"></a>
-<span class="sourceLineNo">524</span>  }<a name="line.524"></a>
-<span class="sourceLineNo">525</span><a name="line.525"></a>
-<span class="sourceLineNo">526</span>  /**<a name="line.526"></a>
-<span class="sourceLineNo">527</span>   * Execute the procedure up to "lastStep" and then the ProcedureExecutor<a name="line.527"></a>
-<span class="sourceLineNo">528</span>   * is restarted and an abort() is injected.<a name="line.528"></a>
-<span class="sourceLineNo">529</span>   * If the procedure implement abort() this should result in rollback being triggered.<a name="line.529"></a>
-<span class="sourceLineNo">530</span>   * At the end of this call the procedure should be finished and rolledback.<a name="line.530"></a>
-<span class="sourceLineNo">531</span>   * This method assert on the procedure being terminated with an AbortException.<a name="line.531"></a>
-<span class="sourceLineNo">532</span>   */<a name="line.532"></a>
-<span class="sourceLineNo">533</span>  public static void testRollbackRetriableFailure(<a name="line.533"></a>
-<span class="sourceLineNo">534</span>      final ProcedureExecutor&lt;MasterProcedureEnv&gt; procExec, final long procId,<a name="line.534"></a>
-<span class="sourceLineNo">535</span>      final int lastStep) throws Exception {<a name="line.535"></a>
-<span class="sourceLineNo">536</span>    // Execute up to last step<a name="line.536"></a>
-<span class="sourceLineNo">537</span>    testRecoveryAndDoubleExecution(procExec, procId, lastStep, false);<a name="line.537"></a>
-<span class="sourceLineNo">538</span><a name="line.538"></a>
-<span class="sourceLineNo">539</span>    // execute the rollback<a name="line.539"></a>
-<span class="sourceLineNo">540</span>    testRestartWithAbort(procExec, procId);<a name="line.540"></a>
-<span class="sourceLineNo">541</span><a name="line.541"></a>
-<span class="sourceLineNo">542</span>    assertEquals(true, procExec.isRunning());<a name="line.542"></a>
-<span class="sourceLineNo">543</span>    ProcedureTestingUtility.assertIsAbortException(procExec.getResult(procId));<a name="line.543"></a>
-<span class="sourceLineNo">544</span>  }<a name="line.544"></a>
-<span class="sourceLineNo">545</span><a name="line.545"></a>
-<span class="sourceLineNo">546</span>  /**<a name="line.546"></a>
-<span class="sourceLineNo">547</span>   * Restart the ProcedureExecutor and inject an abort to the specified procedure.<a name="line.547"></a>
-<span class="sourceLineNo">548</span>   * If the procedure implement abort() this should result in rollback being triggered.<a name="line.548"></a>
-<span class="sourceLineNo">549</span>   * At the end of this call the procedure should be finished and rolledback, if abort is implemnted<a name="line.549"></a>
-<span class="sourceLineNo">550</span>   */<a name="line.550"></a>
-<span class="sourceLineNo">551</span>  public static void testRestartWithAbort(ProcedureExecutor&lt;MasterProcedureEnv&gt; procExec,<a name="line.551"></a>
-<span class="sourceLineNo">552</span>      long procId) throws Exception {<a name="line.552"></a>
-<span class="sourceLineNo">553</span>    ProcedureTestingUtility.setKillAndToggleBeforeStoreUpdate(procExec, false);<a name="line.553"></a>
-<span class="sourceLineNo">554</span>    InjectAbortOnLoadListener abortListener = new InjectAbortOnLoadListener(procExec);<a name="line.554"></a>
-<span class="sourceLineNo">555</span>    abortListener.addProcId(procId);<a name="line.555"></a>
-<span class="sourceLineNo">556</span>    procExec.registerListener(abortListener);<a name="line.556"></a>
-<span class="sourceLineNo">557</span>    try {<a name="line.557"></a>
-<span class="sourceLineNo">558</span>      ProcedureTestingUtility.assertProcNotYetCompleted(procExec, procId);<a name="line.558"></a>
-<span class="sourceLineNo">559</span>      LOG.info("Restart and rollback procId=" + procId);<a name="line.559"></a>
-<span class="sourceLineNo">560</span>      restartMasterProcedureExecutor(procExec);<a name="line.560"></a>
-<span class="sourceLineNo">561</span>      ProcedureTestingUtility.waitProcedure(procExec, procId);<a name="line.561"></a>
-<span class="sourceLineNo">562</span>    } finally {<a name="line.562"></a>
-<span class="sourceLineNo">563</span>      assertTrue(procExec.unregisterListener(abortListener));<a name="line.563"></a>
-<span class="sourceLineNo">564</span>    }<a name="line.564"></a>
-<span class="sourceLineNo">565</span>  }<a name="line.565"></a>
-<span class="sourceLineNo">566</span><a name="line.566"></a>
-<span class="sourceLineNo">567</span>  public static class InjectAbortOnLoadListener<a name="line.567"></a>
-<span class="sourceLineNo">568</span>      implements ProcedureExecutor.ProcedureExecutorListener {<a name="line.568"></a>
-<span class="sourceLineNo">569</span>    private final ProcedureExecutor&lt;MasterProcedureEnv&gt; procExec;<a name="line.569"></a>
-<span class="sourceLineNo">570</span>    private TreeSet&lt;Long&gt; procsToAbort = null;<a name="line.570"></a>
+<span class="sourceLineNo">513</span>      ProcedureTestingUtility.setKillAndToggleBeforeStoreUpdate(procExec, false);<a name="line.513"></a>
+<span class="sourceLineNo">514</span>      // check 3 times to confirm that the procedure executor has not been killed<a name="line.514"></a>
+<span class="sourceLineNo">515</span>      for (int i = 0; i &lt; 3; i++) {<a name="line.515"></a>
+<span class="sourceLineNo">516</span>        if (!procExec.isRunning()) {<a name="line.516"></a>
+<span class="sourceLineNo">517</span>          LOG.warn("ProcedureExecutor not running, may have been stopped by pending procedure due" +<a name="line.517"></a>
+<span class="sourceLineNo">518</span>            " to KillAndToggleBeforeStoreUpdate flag.");<a name="line.518"></a>
+<span class="sourceLineNo">519</span>          restartMasterProcedureExecutor(procExec);<a name="line.519"></a>
+<span class="sourceLineNo">520</span>          break;<a name="line.520"></a>
+<span class="sourceLineNo">521</span>        }<a name="line.521"></a>
+<span class="sourceLineNo">522</span>        Thread.sleep(1000);<a name="line.522"></a>
+<span class="sourceLineNo">523</span>      }<a name="line.523"></a>
+<span class="sourceLineNo">524</span>      ProcedureTestingUtility.waitNoProcedureRunning(procExec);<a name="line.524"></a>
+<span class="sourceLineNo">525</span>    }<a name="line.525"></a>
+<span class="sourceLineNo">526</span><a name="line.526"></a>
+<span class="sourceLineNo">527</span>    assertEquals(true, procExec.isRunning());<a name="line.527"></a>
+<span class="sourceLineNo">528</span>    ProcedureTestingUtility.assertIsAbortException(procExec.getResult(procId));<a name="line.528"></a>
+<span class="sourceLineNo">529</span>  }<a name="line.529"></a>
+<span class="sourceLineNo">530</span><a name="line.530"></a>
+<span class="sourceLineNo">531</span>  /**<a name="line.531"></a>
+<span class="sourceLineNo">532</span>   * Execute the procedure up to "lastStep" and then the ProcedureExecutor<a name="line.532"></a>
+<span class="sourceLineNo">533</span>   * is restarted and an abort() is injected.<a name="line.533"></a>
+<span class="sourceLineNo">534</span>   * If the procedure implement abort() this should result in rollback being triggered.<a name="line.534"></a>
+<span class="sourceLineNo">535</span>   * At the end of this call the procedure should be finished and rolledback.<a name="line.535"></a>
+<span class="sourceLineNo">536</span>   * This method assert on the procedure being terminated with an AbortException.<a name="line.536"></a>
+<span class="sourceLineNo">537</span>   */<a name="line.537"></a>
+<span class="sourceLineNo">538</span>  public static void testRollbackRetriableFailure(<a name="line.538"></a>
+<span class="sourceLineNo">539</span>      final ProcedureExecutor&lt;MasterProcedureEnv&gt; procExec, final long procId,<a name="line.539"></a>
+<span class="sourceLineNo">540</span>      final int lastStep) throws Exception {<a name="line.540"></a>
+<span class="sourceLineNo">541</span>    // Execute up to last step<a name="line.541"></a>
+<span class="sourceLineNo">542</span>    testRecoveryAndDoubleExecution(procExec, procId, lastStep, false);<a name="line.542"></a>
+<span class="sourceLineNo">543</span><a name="line.543"></a>
+<span class="sourceLineNo">544</span>    // execute the rollback<a name="line.544"></a>
+<span class="sourceLineNo">545</span>    testRestartWithAbort(procExec, procId);<a name="line.545"></a>
+<span class="sourceLineNo">546</span><a name="line.546"></a>
+<span class="sourceLineNo">547</span>    assertEquals(true, procExec.isRunning());<a name="line.547"></a>
+<span class="sourceLineNo">548</span>    ProcedureTestingUtility.assertIsAbortException(procExec.getResult(procId));<a name="line.548"></a>
+<span class="sourceLineNo">549</span>  }<a name="line.549"></a>
+<span class="sourceLineNo">550</span><a name="line.550"></a>
+<span class="sourceLineNo">551</span>  /**<a name="line.551"></a>
+<span class="sourceLineNo">552</span>   * Restart the ProcedureExecutor and inject an abort to the specified procedure.<a name="line.552"></a>
+<span class="sourceLineNo">553</span>   * If the procedure implement abort() this should result in rollback being triggered.<a name="line.553"></a>
+<span class="sourceLineNo">554</span>   * At the end of this call the procedure should be finished and rolledback, if abort is implemnted<a name="line.554"></a>
+<span class="sourceLineNo">555</span>   */<a name="line.555"></a>
+<span class="sourceLineNo">556</span>  public static void testRestartWithAbort(ProcedureExecutor&lt;MasterProcedureEnv&gt; procExec,<a name="line.556"></a>
+<span class="sourceLineNo">557</span>      long procId) throws Exception {<a name="line.557"></a>
+<span class="sourceLineNo">558</span>    ProcedureTestingUtility.setKillAndToggleBeforeStoreUpdate(procExec, false);<a name="line.558"></a>
+<span class="sourceLineNo">559</span>    InjectAbortOnLoadListener abortListener = new InjectAbortOnLoadListener(procExec);<a name="line.559"></a>
+<span class="sourceLineNo">560</span>    abortListener.addProcId(procId);<a name="line.560"></a>
+<span class="sourceLineNo">561</span>    procExec.registerListener(abortListener);<a name="line.561"></a>
+<span class="sourceLineNo">562</span>    try {<a name="line.562"></a>
+<span class="sourceLineNo">563</span>      ProcedureTestingUtility.assertProcNotYetCompleted(procExec, procId);<a name="line.563"></a>
+<span class="sourceLineNo">564</span>      LOG.info("Restart and rollback procId=" + procId);<a name="line.564"></a>
+<span class="sourceLineNo">565</span>      restartMasterProcedureExecutor(procExec);<a name="line.565"></a>
+<span class="sourceLineNo">566</span>      ProcedureTestingUtility.waitProcedure(procExec, procId);<a name="line.566"></a>
+<span class="sourceLineNo">567</span>    } finally {<a name="line.567"></a>
+<span class="sourceLineNo">568</span>      assertTrue(procExec.unregisterListener(abortListener));<a name="line.568"></a>
+<span class="sourceLineNo">569</span>    }<a name="line.569"></a>
+<span class="sourceLineNo">570</span>  }<a name="line.570"></a>
 <span class="sourceLineNo">571</span><a name="line.571"></a>
-<span class="sourceLineNo">572</span>    public InjectAbortOnLoadListener(final ProcedureExecutor&lt;MasterProcedureEnv&gt; procExec) {<a name="line.572"></a>
-<span class="sourceLineNo">573</span>      this.procExec = procExec;<a name="line.573"></a>
-<span class="sourceLineNo">574</span>    }<a name="line.574"></a>
-<span class="sourceLineNo">575</span><a name="line.575"></a>
-<span class="sourceLineNo">576</span>    public void addProcId(long procId) {<a name="line.576"></a>
-<span class="sourceLineNo">577</span>      if (procsToAbort == null) {<a name="line.577"></a>
-<span class="sourceLineNo">578</span>        procsToAbort = new TreeSet&lt;&gt;();<a name="line.578"></a>
-<span class="sourceLineNo">579</span>      }<a name="line.579"></a>
-<span class="sourceLineNo">580</span>      procsToAbort.add(procId);<a name="line.580"></a>
-<span class="sourceLineNo">581</span>    }<a name="line.581"></a>
-<span class="sourceLineNo">582</span><a name="line.582"></a>
-<span class="sourceLineNo">583</span>    @Override<a name="line.583"></a>
-<span class="sourceLineNo">584</span>    public void procedureLoaded(long procId) {<a name="line.584"></a>
-<span class="sourceLineNo">585</span>      if (procsToAbort != null &amp;&amp; !procsToAbort.contains(procId)) {<a name="line.585"></a>
-<span class="sourceLineNo">586</span>        return;<a name="line.586"></a>
-<span class="sourceLineNo">587</span>      }<a name="line.587"></a>
-<span class="sourceLineNo">588</span>      procExec.abort(procId);<a name="line.588"></a>
-<span class="sourceLineNo">589</span>    }<a name="line.589"></a>
-<span class="sourceLineNo">590</span><a name="line.590"></a>
-<span class="sourceLineNo">591</span>    @Override<a name="line.591"></a>
-<span class="sourceLineNo">592</span>    public void procedureAdded(long procId) { /* no-op */ }<a name="line.592"></a>
-<span class="sourceLineNo">593</span><a name="line.593"></a>
-<span class="sourceLineNo">594</span>    @Override<a name="line.594"></a>
-<span class="sourceLineNo">595</span>    public void procedureFinished(long procId) { /* no-op */ }<a name="line.595"></a>
-<span class="sourceLineNo">596</span>  }<a name="line.596"></a>
-<span class="sourceLineNo">597</span>}<a name="line.597"></a>
+<span class="sourceLineNo">572</span>  public static class InjectAbortOnLoadListener<a name="line.572"></a>
+<span class="sourceLineNo">573</span>      implements ProcedureExecutor.ProcedureExecutorListener {<a name="line.573"></a>
+<span class="sourceLineNo">574</span>    private final ProcedureExecutor&lt;MasterProcedureEnv&gt; procExec;<a name="line.574"></a>
+<span class="sourceLineNo">575</span>    private TreeSet&lt;Long&gt; procsToAbort = null;<a name="line.575"></a>
+<span class="sourceLineNo">576</span><a name="line.576"></a>
+<span class="sourceLineNo">577</span>    public InjectAbortOnLoadListener(final ProcedureExecutor&lt;MasterProcedureEnv&gt; procExec) {<a name="line.577"></a>
+<span class="sourceLineNo">578</span>      this.procExec = procExec;<a name="line.578"></a>
+<span class="sourceLineNo">579</span>    }<a name="line.579"></a>
+<span class="sourceLineNo">580</span><a name="line.580"></a>
+<span class="sourceLineNo">581</span>    public void addProcId(long procId) {<a name="line.581"></a>
+<span class="sourceLineNo">582</span>      if (procsToAbort == null) {<a name="line.582"></a>
+<span class="sourceLineNo">583</span>        procsToAbort = new TreeSet&lt;&gt;();<a name="line.583"></a>
+<span class="sourceLineNo">584</span>      }<a name="line.584"></a>
+<span class="sourceLineNo">585</span>      procsToAbort.add(procId);<a name="line.585"></a>
+<span class="sourceLineNo">586</span>    }<a name="line.586"></a>
+<span class="sourceLineNo">587</span><a name="line.587"></a>
+<span class="sourceLineNo">588</span>    @Override<a name="line.588"></a>
+<span class="sourceLineNo">589</span>    public void procedureLoaded(long procId) {<a name="line.589"></a>
+<span class="sourceLineNo">590</span>      if (procsToAbort != null &amp;&amp; !procsToAbort.contains(procId)) {<a name="line.590"></a>
+<span class="sourceLineNo">591</span>        return;<a name="line.591"></a>
+<span class="sourceLineNo">592</span>      }<a name="line.592"></a>
+<span class="sourceLineNo">593</span>      procExec.abort(procId);<a name="line.593"></a>
+<span class="sourceLineNo">594</span>    }<a name="line.594"></a>
+<span class="sourceLineNo">595</span><a name="line.595"></a>
+<span class="sourceLineNo">596</span>    @Override<a name="line.596"></a>
+<span class="sourceLineNo">597</span>    public void procedureAdded(long procId) { /* no-op */ }<a name="line.597"></a>
+<span class="sourceLineNo">598</span><a name="line.598"></a>
+<span class="sourceLineNo">599</span>    @Override<a name="line.599"></a>
+<span class="sourceLineNo">600</span>    public void procedureFinished(long procId) { /* no-op */ }<a name="line.600"></a>
+<span class="sourceLineNo">601</span>  }<a name="line.601"></a>
+<span class="sourceLineNo">602</span>}<a name="line.602"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/6b8b907f/testdevapidocs/src-html/org/apache/hadoop/hbase/master/procedure/MasterProcedureTestingUtility.html
----------------------------------------------------------------------
diff --git a/testdevapidocs/src-html/org/apache/hadoop/hbase/master/procedure/MasterProcedureTestingUtility.html b/testdevapidocs/src-html/org/apache/hadoop/hbase/master/procedure/MasterProcedureTestingUtility.html
index 0c87f49..e276e13 100644
--- a/testdevapidocs/src-html/org/apache/hadoop/hbase/master/procedure/MasterProcedureTestingUtility.html
+++ b/testdevapidocs/src-html/org/apache/hadoop/hbase/master/procedure/MasterProcedureTestingUtility.html
@@ -518,91 +518,96 @@
 <span class="sourceLineNo">510</span>      // Sometimes there are other procedures still executing (including asynchronously spawned by<a name="line.510"></a>
 <span class="sourceLineNo">511</span>      // procId) and due to KillAndToggleBeforeStoreUpdate flag ProcedureExecutor is stopped before<a name="line.511"></a>
 <span class="sourceLineNo">512</span>      // store update. Let all pending procedures finish normally.<a name="line.512"></a>
-<span class="sourceLineNo">513</span>      if (!procExec.isRunning()) {<a name="line.513"></a>
-<span class="sourceLineNo">514</span>        LOG.warn("ProcedureExecutor not running, may have been stopped by pending procedure due to"<a name="line.514"></a>
-<span class="sourceLineNo">515</span>            + " KillAndToggleBeforeStoreUpdate flag.");<a name="line.515"></a>
-<span class="sourceLineNo">516</span>        ProcedureTestingUtility.setKillAndToggleBeforeStoreUpdate(procExec, false);<a name="line.516"></a>
-<span class="sourceLineNo">517</span>        restartMasterProcedureExecutor(procExec);<a name="line.517"></a>
-<span class="sourceLineNo">518</span>        ProcedureTestingUtility.waitNoProcedureRunning(procExec);<a name="line.518"></a>
-<span class="sourceLineNo">519</span>      }<a name="line.519"></a>
-<span class="sourceLineNo">520</span>    }<a name="line.520"></a>
-<span class="sourceLineNo">521</span><a name="line.521"></a>
-<span class="sourceLineNo">522</span>    assertEquals(true, procExec.isRunning());<a name="line.522"></a>
-<span class="sourceLineNo">523</span>    ProcedureTestingUtility.assertIsAbortException(procExec.getResult(procId));<a name="line.523"></a>
-<span class="sourceLineNo">524</span>  }<a name="line.524"></a>
-<span class="sourceLineNo">525</span><a name="line.525"></a>
-<span class="sourceLineNo">526</span>  /**<a name="line.526"></a>
-<span class="sourceLineNo">527</span>   * Execute the procedure up to "lastStep" and then the ProcedureExecutor<a name="line.527"></a>
-<span class="sourceLineNo">528</span>   * is restarted and an abort() is injected.<a name="line.528"></a>
-<span class="sourceLineNo">529</span>   * If the procedure implement abort() this should result in rollback being triggered.<a name="line.529"></a>
-<span class="sourceLineNo">530</span>   * At the end of this call the procedure should be finished and rolledback.<a name="line.530"></a>
-<span class="sourceLineNo">531</span>   * This method assert on the procedure being terminated with an AbortException.<a name="line.531"></a>
-<span class="sourceLineNo">532</span>   */<a name="line.532"></a>
-<span class="sourceLineNo">533</span>  public static void testRollbackRetriableFailure(<a name="line.533"></a>
-<span class="sourceLineNo">534</span>      final ProcedureExecutor&lt;MasterProcedureEnv&gt; procExec, final long procId,<a name="line.534"></a>
-<span class="sourceLineNo">535</span>      final int lastStep) throws Exception {<a name="line.535"></a>
-<span class="sourceLineNo">536</span>    // Execute up to last step<a name="line.536"></a>
-<span class="sourceLineNo">537</span>    testRecoveryAndDoubleExecution(procExec, procId, lastStep, false);<a name="line.537"></a>
-<span class="sourceLineNo">538</span><a name="line.538"></a>
-<span class="sourceLineNo">539</span>    // execute the rollback<a name="line.539"></a>
-<span class="sourceLineNo">540</span>    testRestartWithAbort(procExec, procId);<a name="line.540"></a>
-<span class="sourceLineNo">541</span><a name="line.541"></a>
-<span class="sourceLineNo">542</span>    assertEquals(true, procExec.isRunning());<a name="line.542"></a>
-<span class="sourceLineNo">543</span>    ProcedureTestingUtility.assertIsAbortException(procExec.getResult(procId));<a name="line.543"></a>
-<span class="sourceLineNo">544</span>  }<a name="line.544"></a>
-<span class="sourceLineNo">545</span><a name="line.545"></a>
-<span class="sourceLineNo">546</span>  /**<a name="line.546"></a>
-<span class="sourceLineNo">547</span>   * Restart the ProcedureExecutor and inject an abort to the specified procedure.<a name="line.547"></a>
-<span class="sourceLineNo">548</span>   * If the procedure implement abort() this should result in rollback being triggered.<a name="line.548"></a>
-<span class="sourceLineNo">549</span>   * At the end of this call the procedure should be finished and rolledback, if abort is implemnted<a name="line.549"></a>
-<span class="sourceLineNo">550</span>   */<a name="line.550"></a>
-<span class="sourceLineNo">551</span>  public static void testRestartWithAbort(ProcedureExecutor&lt;MasterProcedureEnv&gt; procExec,<a name="line.551"></a>
-<span class="sourceLineNo">552</span>      long procId) throws Exception {<a name="line.552"></a>
-<span class="sourceLineNo">553</span>    ProcedureTestingUtility.setKillAndToggleBeforeStoreUpdate(procExec, false);<a name="line.553"></a>
-<span class="sourceLineNo">554</span>    InjectAbortOnLoadListener abortListener = new InjectAbortOnLoadListener(procExec);<a name="line.554"></a>
-<span class="sourceLineNo">555</span>    abortListener.addProcId(procId);<a name="line.555"></a>
-<span class="sourceLineNo">556</span>    procExec.registerListener(abortListener);<a name="line.556"></a>
-<span class="sourceLineNo">557</span>    try {<a name="line.557"></a>
-<span class="sourceLineNo">558</span>      ProcedureTestingUtility.assertProcNotYetCompleted(procExec, procId);<a name="line.558"></a>
-<span class="sourceLineNo">559</span>      LOG.info("Restart and rollback procId=" + procId);<a name="line.559"></a>
-<span class="sourceLineNo">560</span>      restartMasterProcedureExecutor(procExec);<a name="line.560"></a>
-<span class="sourceLineNo">561</span>      ProcedureTestingUtility.waitProcedure(procExec, procId);<a name="line.561"></a>
-<span class="sourceLineNo">562</span>    } finally {<a name="line.562"></a>
-<span class="sourceLineNo">563</span>      assertTrue(procExec.unregisterListener(abortListener));<a name="line.563"></a>
-<span class="sourceLineNo">564</span>    }<a name="line.564"></a>
-<span class="sourceLineNo">565</span>  }<a name="line.565"></a>
-<span class="sourceLineNo">566</span><a name="line.566"></a>
-<span class="sourceLineNo">567</span>  public static class InjectAbortOnLoadListener<a name="line.567"></a>
-<span class="sourceLineNo">568</span>      implements ProcedureExecutor.ProcedureExecutorListener {<a name="line.568"></a>
-<span class="sourceLineNo">569</span>    private final ProcedureExecutor&lt;MasterProcedureEnv&gt; procExec;<a name="line.569"></a>
-<span class="sourceLineNo">570</span>    private TreeSet&lt;Long&gt; procsToAbort = null;<a name="line.570"></a>
+<span class="sourceLineNo">513</span>      ProcedureTestingUtility.setKillAndToggleBeforeStoreUpdate(procExec, false);<a name="line.513"></a>
+<span class="sourceLineNo">514</span>      // check 3 times to confirm that the procedure executor has not been killed<a name="line.514"></a>
+<span class="sourceLineNo">515</span>      for (int i = 0; i &lt; 3; i++) {<a name="line.515"></a>
+<span class="sourceLineNo">516</span>        if (!procExec.isRunning()) {<a name="line.516"></a>
+<span class="sourceLineNo">517</span>          LOG.warn("ProcedureExecutor not running, may have been stopped by pending procedure due" +<a name="line.517"></a>
+<span class="sourceLineNo">518</span>            " to KillAndToggleBeforeStoreUpdate flag.");<a name="line.518"></a>
+<span class="sourceLineNo">519</span>          restartMasterProcedureExecutor(procExec);<a name="line.519"></a>
+<span class="sourceLineNo">520</span>          break;<a name="line.520"></a>
+<span class="sourceLineNo">521</span>        }<a name="line.521"></a>
+<span class="sourceLineNo">522</span>        Thread.sleep(1000);<a name="line.522"></a>
+<span class="sourceLineNo">523</span>      }<a name="line.523"></a>
+<span class="sourceLineNo">524</span>      ProcedureTestingUtility.waitNoProcedureRunning(procExec);<a name="line.524"></a>
+<span class="sourceLineNo">525</span>    }<a name="line.525"></a>
+<span class="sourceLineNo">526</span><a name="line.526"></a>
+<span class="sourceLineNo">527</span>    assertEquals(true, procExec.isRunning());<a name="line.527"></a>
+<span class="sourceLineNo">528</span>    ProcedureTestingUtility.assertIsAbortException(procExec.getResult(procId));<a name="line.528"></a>
+<span class="sourceLineNo">529</span>  }<a name="line.529"></a>
+<span class="sourceLineNo">530</span><a name="line.530"></a>
+<span class="sourceLineNo">531</span>  /**<a name="line.531"></a>
+<span class="sourceLineNo">532</span>   * Execute the procedure up to "lastStep" and then the ProcedureExecutor<a name="line.532"></a>
+<span class="sourceLineNo">533</span>   * is restarted and an abort() is injected.<a name="line.533"></a>
+<span class="sourceLineNo">534</span>   * If the procedure implement abort() this should result in rollback being triggered.<a name="line.534"></a>
+<span class="sourceLineNo">535</span>   * At the end of this call the procedure should be finished and rolledback.<a name="line.535"></a>
+<span class="sourceLineNo">536</span>   * This method assert on the procedure being terminated with an AbortException.<a name="line.536"></a>
+<span class="sourceLineNo">537</span>   */<a name="line.537"></a>
+<span class="sourceLineNo">538</span>  public static void testRollbackRetriableFailure(<a name="line.538"></a>
+<span class="sourceLineNo">539</span>      final ProcedureExecutor&lt;MasterProcedureEnv&gt; procExec, final long procId,<a name="line.539"></a>
+<span class="sourceLineNo">540</span>      final int lastStep) throws Exception {<a name="line.540"></a>
+<span class="sourceLineNo">541</span>    // Execute up to last step<a name="line.541"></a>
+<span class="sourceLineNo">542</span>    testRecoveryAndDoubleExecution(procExec, procId, lastStep, false);<a name="line.542"></a>
+<span class="sourceLineNo">543</span><a name="line.543"></a>
+<span class="sourceLineNo">544</span>    // execute the rollback<a name="line.544"></a>
+<span class="sourceLineNo">545</span>    testRestartWithAbort(procExec, procId);<a name="line.545"></a>
+<span class="sourceLineNo">546</span><a name="line.546"></a>
+<span class="sourceLineNo">547</span>    assertEquals(true, procExec.isRunning());<a name="line.547"></a>
+<span class="sourceLineNo">548</span>    ProcedureTestingUtility.assertIsAbortException(procExec.getResult(procId));<a name="line.548"></a>
+<span class="sourceLineNo">549</span>  }<a name="line.549"></a>
+<span class="sourceLineNo">550</span><a name="line.550"></a>
+<span class="sourceLineNo">551</span>  /**<a name="line.551"></a>
+<span class="sourceLineNo">552</span>   * Restart the ProcedureExecutor and inject an abort to the specified procedure.<a name="line.552"></a>
+<span class="sourceLineNo">553</span>   * If the procedure implement abort() this should result in rollback being triggered.<a name="line.553"></a>
+<span class="sourceLineNo">554</span>   * At the end of this call the procedure should be finished and rolledback, if abort is implemnted<a name="line.554"></a>
+<span class="sourceLineNo">555</span>   */<a name="line.555"></a>
+<span class="sourceLineNo">556</span>  public static void testRestartWithAbort(ProcedureExecutor&lt;MasterProcedureEnv&gt; procExec,<a name="line.556"></a>
+<span class="sourceLineNo">557</span>      long procId) throws Exception {<a name="line.557"></a>
+<span class="sourceLineNo">558</span>    ProcedureTestingUtility.setKillAndToggleBeforeStoreUpdate(procExec, false);<a name="line.558"></a>
+<span class="sourceLineNo">559</span>    InjectAbortOnLoadListener abortListener = new InjectAbortOnLoadListener(procExec);<a name="line.559"></a>
+<span class="sourceLineNo">560</span>    abortListener.addProcId(procId);<a name="line.560"></a>
+<span class="sourceLineNo">561</span>    procExec.registerListener(abortListener);<a name="line.561"></a>
+<span class="sourceLineNo">562</span>    try {<a name="line.562"></a>
+<span class="sourceLineNo">563</span>      ProcedureTestingUtility.assertProcNotYetCompleted(procExec, procId);<a name="line.563"></a>
+<span class="sourceLineNo">564</span>      LOG.info("Restart and rollback procId=" + procId);<a name="line.564"></a>
+<span class="sourceLineNo">565</span>      restartMasterProcedureExecutor(procExec);<a name="line.565"></a>
+<span class="sourceLineNo">566</span>      ProcedureTestingUtility.waitProcedure(procExec, procId);<a name="line.566"></a>
+<span class="sourceLineNo">567</span>    } finally {<a name="line.567"></a>
+<span class="sourceLineNo">568</span>      assertTrue(procExec.unregisterListener(abortListener));<a name="line.568"></a>
+<span class="sourceLineNo">569</span>    }<a name="line.569"></a>
+<span class="sourceLineNo">570</span>  }<a name="line.570"></a>
 <span class="sourceLineNo">571</span><a name="line.571"></a>
-<span class="sourceLineNo">572</span>    public InjectAbortOnLoadListener(final ProcedureExecutor&lt;MasterProcedureEnv&gt; procExec) {<a name="line.572"></a>
-<span class="sourceLineNo">573</span>      this.procExec = procExec;<a name="line.573"></a>
-<span class="sourceLineNo">574</span>    }<a name="line.574"></a>
-<span class="sourceLineNo">575</span><a name="line.575"></a>
-<span class="sourceLineNo">576</span>    public void addProcId(long procId) {<a name="line.576"></a>
-<span class="sourceLineNo">577</span>      if (procsToAbort == null) {<a name="line.577"></a>
-<span class="sourceLineNo">578</span>        procsToAbort = new TreeSet&lt;&gt;();<a name="line.578"></a>
-<span class="sourceLineNo">579</span>      }<a name="line.579"></a>
-<span class="sourceLineNo">580</span>      procsToAbort.add(procId);<a name="line.580"></a>
-<span class="sourceLineNo">581</span>    }<a name="line.581"></a>
-<span class="sourceLineNo">582</span><a name="line.582"></a>
-<span class="sourceLineNo">583</span>    @Override<a name="line.583"></a>
-<span class="sourceLineNo">584</span>    public void procedureLoaded(long procId) {<a name="line.584"></a>
-<span class="sourceLineNo">585</span>      if (procsToAbort != null &amp;&amp; !procsToAbort.contains(procId)) {<a name="line.585"></a>
-<span class="sourceLineNo">586</span>        return;<a name="line.586"></a>
-<span class="sourceLineNo">587</span>      }<a name="line.587"></a>
-<span class="sourceLineNo">588</span>      procExec.abort(procId);<a name="line.588"></a>
-<span class="sourceLineNo">589</span>    }<a name="line.589"></a>
-<span class="sourceLineNo">590</span><a name="line.590"></a>
-<span class="sourceLineNo">591</span>    @Override<a name="line.591"></a>
-<span class="sourceLineNo">592</span>    public void procedureAdded(long procId) { /* no-op */ }<a name="line.592"></a>
-<span class="sourceLineNo">593</span><a name="line.593"></a>
-<span class="sourceLineNo">594</span>    @Override<a name="line.594"></a>
-<span class="sourceLineNo">595</span>    public void procedureFinished(long procId) { /* no-op */ }<a name="line.595"></a>
-<span class="sourceLineNo">596</span>  }<a name="line.596"></a>
-<span class="sourceLineNo">597</span>}<a name="line.597"></a>
+<span class="sourceLineNo">572</span>  public static class InjectAbortOnLoadListener<a name="line.572"></a>
+<span class="sourceLineNo">573</span>      implements ProcedureExecutor.ProcedureExecutorListener {<a name="line.573"></a>
+<span class="sourceLineNo">574</span>    private final ProcedureExecutor&lt;MasterProcedureEnv&gt; procExec;<a name="line.574"></a>
+<span class="sourceLineNo">575</span>    private TreeSet&lt;Long&gt; procsToAbort = null;<a name="line.575"></a>
+<span class="sourceLineNo">576</span><a name="line.576"></a>
+<span class="sourceLineNo">577</span>    public InjectAbortOnLoadListener(final ProcedureExecutor&lt;MasterProcedureEnv&gt; procExec) {<a name="line.577"></a>
+<span class="sourceLineNo">578</span>      this.procExec = procExec;<a name="line.578"></a>
+<span class="sourceLineNo">579</span>    }<a name="line.579"></a>
+<span class="sourceLineNo">580</span><a name="line.580"></a>
+<span class="sourceLineNo">581</span>    public void addProcId(long procId) {<a name="line.581"></a>
+<span class="sourceLineNo">582</span>      if (procsToAbort == null) {<a name="line.582"></a>
+<span class="sourceLineNo">583</span>        procsToAbort = new TreeSet&lt;&gt;();<a name="line.583"></a>
+<span class="sourceLineNo">584</span>      }<a name="line.584"></a>
+<span class="sourceLineNo">585</span>      procsToAbort.add(procId);<a name="line.585"></a>
+<span class="sourceLineNo">586</span>    }<a name="line.586"></a>
+<span class="sourceLineNo">587</span><a name="line.587"></a>
+<span class="sourceLineNo">588</span>    @Override<a name="line.588"></a>
+<span class="sourceLineNo">589</span>    public void procedureLoaded(long procId) {<a name="line.589"></a>
+<span class="sourceLineNo">590</span>      if (procsToAbort != null &amp;&amp; !procsToAbort.contains(procId)) {<a name="line.590"></a>
+<span class="sourceLineNo">591</span>        return;<a name="line.591"></a>
+<span class="sourceLineNo">592</span>      }<a name="line.592"></a>
+<span class="sourceLineNo">593</span>      procExec.abort(procId);<a name="line.593"></a>
+<span class="sourceLineNo">594</span>    }<a name="line.594"></a>
+<span class="sourceLineNo">595</span><a name="line.595"></a>
+<span class="sourceLineNo">596</span>    @Override<a name="line.596"></a>
+<span class="sourceLineNo">597</span>    public void procedureAdded(long procId) { /* no-op */ }<a name="line.597"></a>
+<span class="sourceLineNo">598</span><a name="line.598"></a>
+<span class="sourceLineNo">599</span>    @Override<a name="line.599"></a>
+<span class="sourceLineNo">600</span>    public void procedureFinished(long procId) { /* no-op */ }<a name="line.600"></a>
+<span class="sourceLineNo">601</span>  }<a name="line.601"></a>
+<span class="sourceLineNo">602</span>}<a name="line.602"></a>
 
 
 


Mime
View raw message