You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "dataroaring (via GitHub)" <gi...@apache.org> on 2023/06/15 13:16:34 UTC

[GitHub] [doris] dataroaring opened a new pull request, #20872: [fix](replica) do not delete the only one replica

dataroaring opened a new pull request, #20872:
URL: https://github.com/apache/doris/pull/20872

   ## Proposed changes
   
     We can not delete the only one replica of a tablet internally.
   
   Issue Number: close #xxx
   
   <!--Describe your changes.-->
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
   
   


-- 
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-unsubscribe@doris.apache.org

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


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


[GitHub] [doris] github-actions[bot] commented on pull request #20872: [fix](replica) do not delete the only one replica

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20872:
URL: https://github.com/apache/doris/pull/20872#issuecomment-1593255400

   PR approved by anyone and no changes requested.


-- 
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-unsubscribe@doris.apache.org

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


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


[GitHub] [doris] yujun777 commented on a diff in pull request #20872: [fix](replica) do not delete the only one replica

Posted by "yujun777 (via GitHub)" <gi...@apache.org>.
yujun777 commented on code in PR #20872:
URL: https://github.com/apache/doris/pull/20872#discussion_r1231161100


##########
fe/fe-core/src/main/java/org/apache/doris/clone/TabletScheduler.java:
##########
@@ -1113,6 +1103,21 @@ private void deleteReplicaInternal(TabletSchedCtx tabletCtx,
             }
         }
 
+        List<Replica> replicas = tabletCtx.getTablet().getReplicas();
+        int matchupReplicaCount = 0;
+        for (Replica tmpReplica : replicas) {
+            if (tmpReplica.getVersion() >= replica.getVersion()) {
+                matchupReplicaCount++;
+            }
+        }
+
+        if (matchupReplicaCount <= 1) {
+            LOG.info("can not delete only one replica, tabletId = {} replicaId = {}", tabletCtx.getTabletId(),
+                     replica.getId());
+            throw new SchedException(Status.FINISHED, "the only one latest replia can not be dropped, tabletId = "
+                                        + tabletCtx.getTabletId() + ", replicaId = " + replica.getId());
+        }
+

Review Comment:
   Can move the-only-one check to the begining of this function ?  Otherwise this replica will change to  decommission state.



-- 
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-unsubscribe@doris.apache.org

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


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


[GitHub] [doris] dataroaring merged pull request #20872: [fix](replica) do not delete the only one replica

Posted by "dataroaring (via GitHub)" <gi...@apache.org>.
dataroaring merged PR #20872:
URL: https://github.com/apache/doris/pull/20872


-- 
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-unsubscribe@doris.apache.org

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


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


[GitHub] [doris] github-actions[bot] commented on pull request #20872: [fix](replica) do not delete the only one replica

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20872:
URL: https://github.com/apache/doris/pull/20872#issuecomment-1594147442

   PR approved by at least one committer and no changes requested.


-- 
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-unsubscribe@doris.apache.org

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


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


[GitHub] [doris] dataroaring commented on pull request #20872: [fix](replica) do not delete the only one replica

Posted by "dataroaring (via GitHub)" <gi...@apache.org>.
dataroaring commented on PR #20872:
URL: https://github.com/apache/doris/pull/20872#issuecomment-1593071790

   run buildall


-- 
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-unsubscribe@doris.apache.org

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


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


[GitHub] [doris] dataroaring commented on pull request #20872: [fix](replica) do not delete the only one replica

Posted by "dataroaring (via GitHub)" <gi...@apache.org>.
dataroaring commented on PR #20872:
URL: https://github.com/apache/doris/pull/20872#issuecomment-1593254752

   run buildall


-- 
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-unsubscribe@doris.apache.org

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


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


[GitHub] [doris] yujun777 commented on pull request #20872: [fix](replica) do not delete the only one replica

Posted by "yujun777 (via GitHub)" <gi...@apache.org>.
yujun777 commented on PR #20872:
URL: https://github.com/apache/doris/pull/20872#issuecomment-1593254395

   LGTM


-- 
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-unsubscribe@doris.apache.org

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


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