morningman commented on code in PR #9424:
URL: https://github.com/apache/incubator-doris/pull/9424#discussion_r867326361


##########
fe/fe-core/src/main/java/org/apache/doris/clone/TabletSchedCtx.java:
##########
@@ -1184,4 +1186,24 @@ public int compare(Replica r1, Replica r2) {
             }
         }
     }
+
+    // call this when releaseTabletCtx()
+    public void resetReplicaState() {
+        if (tablet != null) {
+            for (Replica replica : tablet.getReplicas()) {
+                // To address issue: 
https://github.com/apache/incubator-doris/issues/9422
+                // the DECOMMISSION state is set in TabletScheduler and not 
persist to meta.
+                // So it is reasonable to reset this state if we failed to 
scheduler this tablet.
+                // That is, if the TabletScheduler cannot process the tablet, 
then it should reset
+                // any intermediate state it set during the scheduling process.
+                if (replica.getState() == ReplicaState.DECOMMISSION) {
+                    replica.setState(ReplicaState.NORMAL);
+                    replica.setWatermarkTxnId(-1);
+                    LOG.debug("reset replica {} on backend {} of tablet {} 
state from DECOMMISSION to NORMAL",

Review Comment:
   It may print a lot log. And actually, this is not an error. It is a common 
case.



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to