liuxiaocs7 commented on code in PR #8439:
URL: https://github.com/apache/hbase/pull/8439#discussion_r3494140030


##########
hbase-server/src/test/java/org/apache/hadoop/hbase/util/RSProcDispatcher.java:
##########
@@ -76,23 +146,22 @@ public TestExecuteProceduresRemoteCall(ServerName 
serverName,
     @Override
     public AdminProtos.ExecuteProceduresResponse sendRequest(final ServerName 
serverName,
       final AdminProtos.ExecuteProceduresRequest request) throws IOException {
-      int j = I.addAndGet(1);
-      LOG.info("sendRequest() req: {} , j: {}", request, j);
-      if (j == 12 || j == 22) {
-        // Execute the remote close and open region requests in the last (5th) 
retry before
-        // throwing ConnectionClosedException. This is to ensure even if the 
region open/close
-        // is successfully completed by regionserver, master still schedules 
SCP because
-        // sendRequest() throws error which has retry-limit exhausted.
-        FutureUtils.get(getRsAdmin().executeProcedures(request));
+      if (injectErrors == null) {
+        // Claim a slot only for a target-table open/close request, once per 
instance.
+        injectErrors =
+          INJECT.get() && targetsInjectionTable(request) && 
VICTIMS_REMAINING.getAndDecrement() > 0;
+      }
+      LOG.info("sendRequest() req: {}, attempts: {}, injectErrors: {}", 
request, attempts,
+        injectErrors);
+      if (!injectErrors) {
+        return FutureUtils.get(getRsAdmin().executeProcedures(request));
       }
-      // For one of the close region requests and one of the open region 
requests,
-      // throw ConnectionClosedException until retry limit is exhausted and 
master
-      // schedules recoveries for the server.
-      // We will have ABNORMALLY_CLOSED regions, and they are expected to 
recover on their own.
-      if (j >= 8 && j <= 13 || j >= 18 && j <= 23) {
-        throw ERRORS.get(ERROR_IDX.getAndIncrement() % ERRORS.size());
+      // Throw a connection error each attempt until the retry limit is 
exhausted (-> SCP). On the
+      // last attempt run the real open/close first so the region still 
recovers.
+      if (attempts++ >= failFastLimit - 1) {
+        FutureUtils.get(getRsAdmin().executeProcedures(request));
       }
-      return FutureUtils.get(getRsAdmin().executeProcedures(request));

Review Comment:
   The judgment here is actually not stable enough



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to