apecloud / kubeblocks

KubeBlocks is an open-source control plane software that runs and manages databases, message queues and other stateful applications on K8s.
https://kubeblocks.io
GNU Affero General Public License v3.0
2.13k stars 176 forks source link

[BUG] mysql scale cluster bench error: DDL command denied to user 'root' #6728

Open JashBook opened 8 months ago

JashBook commented 8 months ago

Describe the bug

kbcli version
Kubernetes: v1.26.3
KubeBlocks: 0.9.0-alpha.5
kbcli: 0.9.0-alpha.1

To Reproduce Steps to reproduce the behavior:

  1. create mysql scale cluster
    kbcli cluster create  mysql scale-joqsje                 --mode='raftGroup'                 --cpu=0.5                 --memory=1                 --storage=20                 --availability-policy=none --termination-policy=WipeOut  --version=ac-mysql-8.0.30-1  --replicas=3                     --proxy-enabled=true  --namespace default
  2. do sysbench
    kbcli bench  sysbench benchtest-scale-joqsje --cluster scale-joqsje --host scale-joqsje-vtgate.default.svc --user root --password "7bwd64fh" --database benchtest  --namespace default --port 15306 --threads 4                     --type oltp_read_write --tables 4 --size 1000 --duration 10 --driver mysql                      --extra-args="--auto_inc=false"
  3. See error
    kubectl get pod
    NAME                                            READY   STATUS      RESTARTS       AGE
    benchtest-scale-joqsje-cleanup-96cc7            0/1     Completed   0              7m35s
    benchtest-scale-joqsje-precheck-hx27v           0/1     Completed   0              7m39s
    benchtest-scale-joqsje-prepare-gvdll            0/1     Completed   0              7m28s
    benchtest-scale-joqsje-run-0-qcd55              2/2     Running     0              7m22s

    logs bench pod

    
    ➜  ~ kubectl logs benchtest-scale-joqsje-run-0-qcd55 kubebench
    run sysbench
    check mysql database exists
    mysql host scale-joqsje-vtgate.default.svc connect success!
    database benchtest exists
    /usr/bin/sysbench
    cd ./sysbench/src/lua;sysbench --db-driver=mysql --mysql-host=scale-joqsje-vtgate.default.svc --mysql-port=15306 --mysql-user=root --mysql-password=7bwd64fh --mysql-db=benchtest --table_size=1000 --tables=4 --time=10 --threads=4 --events=0 --percentile=99 --auto_inc=false --report-interval=1 oltp_read_write run
    sysbench 1.0.20 (using system LuaJIT 2.1.0-beta3)

Running the test with following options: Number of threads: 4 Report intermediate results every 1 second(s) Initializing random number generator from current time

Initializing worker threads...

FATAL: mysql_stmt_prepare() failed FATAL: MySQL error: 1045 "target: benchtest.0.replica: vttablet: rpc error: code = PermissionDenied desc = SelectImpossible command denied to user 'root' for table 'sbtest1' (ACL check error) (CallerID: root)" FATAL: thread_init' function failed: ./oltp_common.lua:305: SQL API error FATAL: mysql_stmt_prepare() failed FATAL: MySQL error: 1045 "target: benchtest.0.replica: vttablet: rpc error: code = PermissionDenied desc = SelectImpossible command denied to user 'root' for table 'sbtest1' (ACL check error) (CallerID: root)" FATAL:thread_init' function failed: ./oltp_common.lua:305: SQL API error FATAL: mysql_stmt_prepare() failed FATAL: MySQL error: 1045 "target: benchtest.0.replica: vttablet: rpc error: code = PermissionDenied desc = SelectImpossible command denied to user 'root' for table 'sbtest1' (ACL check error) (CallerID: root)" FATAL: thread_init' function failed: ./oltp_common.lua:305: SQL API error FATAL: mysql_stmt_prepare() failed FATAL: MySQL error: 1045 "target: benchtest.0.replica: vttablet: rpc error: code = PermissionDenied desc = SelectImpossible command denied to user 'root' for table 'sbtest1' (ACL check error) (CallerID: root)" FATAL:thread_init' function failed: ./oltp_common.lua:305: SQL API error FATAL: Thread initialization failed! []



**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
 - OS: [e.g. iOS]
 - Browser [e.g. chrome, safari]
 - Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
gerayking commented 8 months ago

fixed by https://github.com/apecloud/kubeblocks-addons/pull/341