You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "deardeng (via GitHub)" <gi...@apache.org> on 2026/05/19 09:04:25 UTC

[PR] [test](docker) Verify DML and 3-replica create table when one BE is down [doris]

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

   Add a non-cloud docker regression case that brings up 1 FE + 4 BE, stops one BE, and then verifies on the remaining 3 BEs:
   
     1. truncate / delete / update on an existing 3-replica MOW unique-key table (now with 2 replicas alive per tablet) still succeed.
     2. Creating a new 3-replica table still succeeds and the replicas are distributed across the 3 alive BEs.
   
   ### What problem does this PR solve?
   
   Issue Number: close #xxx
   
   Related PR: #xxx
   
   Problem Summary:
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Test <!-- At least one of them must be included. -->
       - [x] Regression test
       - [ ] Unit Test
       - [ ] Manual test (add detailed scripts or steps below)
       - [ ] No need to test or manual test. Explain why:
           - [ ] This is a refactor/code format and no logic has been changed.
           - [ ] Previous test can cover this change.
           - [ ] No code files have been changed.
           - [ ] Other reason <!-- Add your reason?  -->
   
   - Behavior changed:
       - [x] No.
       - [ ] Yes. <!-- Explain the behavior change -->
   
   - Does this need documentation?
       - [x] No.
       - [ ] Yes. <!-- Add document PR link here. eg: https://github.com/apache/doris-website/pull/1214 -->
   
   ### Check List (For Reviewer who merge this PR)
   
   - [ ] Confirm the release note
   - [ ] Confirm test cases
   - [ ] Confirm document
   - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into -->
   
   


-- 
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


Re: [PR] [test](docker) Verify DML and 3-replica create table when one BE is down [doris]

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

   /review


-- 
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


Re: [PR] [test](docker) Verify DML and 3-replica create table when one BE is down [doris]

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

   
   Thank you for your contribution to Apache Doris.
   Don't know what should be done next? See [How to process your PR](https://cwiki.apache.org/confluence/display/DORIS/How+to+process+your+PR).
   
   Please clearly describe your PR:
   1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
   2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
   3. What features were added. Why was this function added?
   4. Which code was refactored and why was this part of the code refactored?
   5. Which functions were optimized and what is the difference before and after the optimization?
       


-- 
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


Re: [PR] [test](docker) Verify DML and 3-replica create table when one BE is down [doris]

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

   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


Re: [PR] [test](docker) Verify DML and 3-replica create table when one BE is down [doris]

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


##########
regression-test/suites/fault_injection_p0/test_dml_when_one_be_down.groovy:
##########
@@ -0,0 +1,129 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+import org.apache.doris.regression.suite.ClusterOptions
+
+// Non-cloud (storage-compute integrated) cluster with 1 FE + 4 BE. After
+// stopping one BE (3 BE left alive), verify:
+//   1. truncate / delete / update on the existing 3-replica table (now with
+//      only 2 replicas alive per tablet) still work correctly;
+//   2. creating a new 3-replica table still succeeds (alive BE count ==
+//      replica count).
+suite("test_dml_when_one_be_down", "docker") {
+    def options = new ClusterOptions()
+    options.cloudMode = false
+    options.feNum = 1
+    options.beNum = 4
+
+    docker(options) {
+        // All 4 BEs are alive at the start.
+        def aliveBeNum = sql_return_maparray("SHOW BACKENDS")
+                .count { it.Alive.toString().equalsIgnoreCase("true") }
+        assertEquals(4, aliveBeNum)
+
+        def tbl = "test_dml_be_down_tbl"
+        sql """ DROP TABLE IF EXISTS ${tbl} """
+        sql """
+            CREATE TABLE ${tbl} (
+                `k` int NOT NULL,
+                `v` int NOT NULL
+            )
+            UNIQUE KEY(`k`)
+            DISTRIBUTED BY HASH(`k`) BUCKETS 4
+            PROPERTIES (
+                "replication_allocation" = "tag.location.default: 3",
+                "enable_unique_key_merge_on_write" = "true"
+            )
+        """
+        sql """ INSERT INTO ${tbl} VALUES (1, 10), (2, 20), (3, 30), (4, 40) """
+        def initCount = sql """ SELECT COUNT(*) FROM ${tbl} """
+        assertEquals(4L, initCount[0][0])
+
+        // Stop BE 1. stopBackends() internally waits ~7s for the FE
+        // heartbeat to mark the BE as dead.
+        cluster.stopBackends(1)
+        cluster.checkBeIsAlive(1, false)
+
+        // Poll SHOW BACKENDS to make sure FE sees only 3 alive BEs.
+        def alive = 0
+        for (int i = 0; i < 60; i++) {
+            alive = sql_return_maparray("SHOW BACKENDS")
+                    .count { it.Alive.toString().equalsIgnoreCase("true") }
+            if (alive == 3) {
+                break
+            }
+            sleep(1000)
+        }
+        assertEquals(3, alive)
+
+        // ---- 1. update / delete / truncate on the 3-replica table
+        //         (only 2 replicas alive per tablet) ----
+
+        // 1.1 update: a MOW unique-key table write still satisfies the
+        //     quorum requirement with 2 out of 3 replicas alive.
+        sql """ UPDATE ${tbl} SET v = v + 100 WHERE k = 1 """

Review Comment:
   This test does not guarantee that the `UPDATE`/`DELETE` actually hit a tablet that lost a replica when BE 1 was stopped. With 4 BEs and replication 3, some tablets can be placed only on the other three BEs, so fixed keys like `k = 1` and `k = 2` may exercise the normal all-replicas-alive path and still pass even if DML fails for tablets whose replica set includes the stopped BE. Please make the setup deterministic, for example by inspecting `SHOW TABLETS`/`SHOW TABLET` before stopping a BE and choosing the BE and keys/tablets so the exercised DML targets tablets that contain the stopped backend, or by asserting the affected tablets have exactly two alive replicas before running the DML.



-- 
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


Re: [PR] [test](docker) Verify DML and 3-replica create table when one BE is down [doris]

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

   /review


-- 
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


Re: [PR] [test](docker) Verify DML and 3-replica create table when one BE is down [doris]

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

   skip 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


Re: [PR] [test](docker) Verify DML and 3-replica create table when one BE is down [doris]

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

   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


Re: [PR] [test](docker) Verify DML and 3-replica create table when one BE is down [doris]

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


-- 
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