This is an automated email from the ASF dual-hosted git repository.

JNSimba pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 362581596ec [fix](regression) Initialize OceanBase test data 
explicitly (#66141)
362581596ec is described below

commit 362581596ecfc070129911cee2b1893826253e6d
Author: wudi <[email protected]>
AuthorDate: Tue Jul 28 15:30:39 2026 +0800

    [fix](regression) Initialize OceanBase test data explicitly (#66141)
    
    ### What problem does this PR solve?
    
    The OceanBase all-in-one image starts Observer, OBProxy, and OBBinlog,
    but it does not execute SQL files mounted at `/root/boot/init.d`. The
    existing healthcheck queries a table created by those SQL files, so the
    service cannot become healthy and initialization cannot progress.
    
    This change separates service readiness from test-data readiness. The
    main service healthcheck verifies the Observer and OBBinlog endpoints,
    while a dedicated init service waits for the main service to become
    healthy and then executes all initialization SQL files in order. The
    init service reports healthy only after the current initialization run
    completes and the seeded table is readable.
---
 .../docker-compose/oceanbase/oceanbase.yaml.tpl    | 29 ++++++++++++++++++++--
 1 file changed, 27 insertions(+), 2 deletions(-)

diff --git a/docker/thirdparties/docker-compose/oceanbase/oceanbase.yaml.tpl 
b/docker/thirdparties/docker-compose/oceanbase/oceanbase.yaml.tpl
index fee16e3c160..dc8b6de1225 100644
--- a/docker/thirdparties/docker-compose/oceanbase/oceanbase.yaml.tpl
+++ b/docker/thirdparties/docker-compose/oceanbase/oceanbase.yaml.tpl
@@ -30,12 +30,37 @@ services:
       - ${DOCKER_OCEANBASE_EXTERNAL_PORT}:2881
       - ${DOCKER_OCEANBASE_PROXY_EXTERNAL_PORT}:2883
     healthcheck:
-      test: ["CMD-SHELL", "obclient -h127.0.0.1 -P2881 -uroot@test -p123456 -e 
'SELECT * FROM doris_test.all_types LIMIT 1' >/dev/null && obclient -h127.0.0.1 
-P2883 -uroot@test -p123456 -Nse 'SHOW MASTER STATUS' | grep -q ."]
+      test: ["CMD-SHELL", "obclient -h127.0.0.1 -P2881 -uroot@test -p123456 -e 
'SELECT 1' >/dev/null && obclient -h127.0.0.1 -P2883 -uroot@test -p123456 -Nse 
'SHOW MASTER STATUS' | grep -q ."]
+      interval: 5s
+      timeout: 60s
+      retries: 120
+    networks:
+      - doris--oceanbase
+
+  doris--oceanbase-init:
+    image: quay.io/oceanbase/obbinlog-ce:4.2.5-test
+    depends_on:
+      doris--oceanbase:
+        condition: service_healthy
+    entrypoint:
+      - /bin/bash
+      - -c
+      - |
+        set -euo pipefail
+        rm -f /tmp/oceanbase_initialized
+        for sql in /root/boot/init.d/*.sql; do
+          echo "Running $${sql}"
+          obclient -hdoris--oceanbase -P2881 -uroot@test -p123456 < "$${sql}"
+        done
+        touch /tmp/oceanbase_initialized
+        exec tail -f /dev/null
+    healthcheck:
+      test: ["CMD-SHELL", "test -f /tmp/oceanbase_initialized && obclient 
-hdoris--oceanbase -P2881 -uroot@test -p123456 -Nse 'SELECT 1 FROM 
doris_test.all_types LIMIT 1' | grep -q '^1$$'"]
       interval: 5s
       timeout: 60s
       retries: 120
     volumes:
-      - ./init:/root/boot/init.d
+      - ./init:/root/boot/init.d:ro
     networks:
       - doris--oceanbase
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to