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
1.76k stars 155 forks source link

[BUG] starrocks cluster offline instances ERROR 1064 (HY000): Backend node not found. #7697

Open JashBook opened 5 days ago

JashBook commented 5 days ago

Describe the bug

kbcli version
Kubernetes: v1.28.9-gke.1289000
KubeBlocks: 0.9.0-beta.43
kbcli: 0.9.0-beta.2
WARNING: version difference between kbcli (0.9.0-beta.2) and kubeblocks (0.9.0-beta.43) 

ERROR 1064 (HY000): Backend node not found. Check if any backend node is down.backend: [strsent-ksfebl-be-0.strsent-ksfebl-be-headless.default.svc.cluster.local alive: false inBlacklist: false] [strsent-ksfebl-be-1.strsent-ksfebl-be-headless.default.svc.cluster.local alive: true inBlacklist: false]

To Reproduce Steps to reproduce the behavior:

  1. create cluster
    apiVersion: apps.kubeblocks.io/v1alpha1
    kind: Cluster
    metadata:
    name: strsent-ksfebl
    namespace: default
    spec:
    terminationPolicy: Delete
    componentSpecs:
    - name: be
      componentDef: starrocks-be
      replicas: 2
      resources:
        requests:
          cpu: 3000m
          memory: 8Gi
        limits:
          cpu: 3000m
          memory: 8Gi
      volumeClaimTemplates:
        - name: data
          spec:
            storageClassName:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 20Gi
    - name: fe
      componentDef: starrocks-fe-sn
      replicas: 2
      resources:
        requests:
          cpu: 3000m
          memory: 8Gi
        limits:
          cpu: 3000m
          memory: 8Gi
      volumeClaimTemplates:
        - name: data
          spec:
            storageClassName:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 20Gi

    add data

    
    kubectl exec -it strsent-ksfebl-fe-0 -c fe --namespace default bash

mysql -P9030 -hstrsent-ksfebl-fe-fe.default.svc -uroot -p'07tLWM8a70'

CREATE DATABASE IF NOT EXISTS mydb; use mydb; DROP TABLE IF EXISTS tmp_table; CREATE TABLE IF NOT EXISTS tmp_table (id INT, value STRING) PROPERTIES ( 'replication_num' = '1' ); INSERT INTO tmp_table (id, value) VALUES (1,'wiubuespdb');

2. offline instances

apiVersion: apps.kubeblocks.io/v1alpha1 kind: OpsRequest metadata: generateName: strsent-ksfebl-hscaleoffinstance- labels: app.kubernetes.io/instance: strsent-ksfebl app.kubernetes.io/managed-by: kubeblocks namespace: default spec: type: HorizontalScaling clusterRef: strsent-ksfebl force: true horizontalScaling:

kubectl get cluster NAME CLUSTER-DEFINITION VERSION TERMINATION-POLICY STATUS AGE strsent-ksfebl Delete Running 7m6s

kubectl get pod -l app.kubernetes.io/instance=strsent-ksfebl
NAME READY STATUS RESTARTS AGE strsent-ksfebl-be-1 3/3 Running 0 7m10s strsent-ksfebl-fe-0 3/3 Running 0 7m10s strsent-ksfebl-fe-1 3/3 Running 0 7m10s

kubectl get cmp -l app.kubernetes.io/instance=strsent-ksfebl
NAME DEFINITION SERVICE-VERSION STATUS AGE strsent-ksfebl-be starrocks-be 3.2.2 Running 7m23s strsent-ksfebl-fe starrocks-fe-sn 3.2.2 Running 7m23s


5. See error

kubectl exec -it strsent-ksfebl-fe-0 -c fe --namespace default bash

mysql -P9030 -hstrsent-ksfebl-fe-fe.default.svc -uroot -p'07tLWM8a70'

use mydb;

mysql> SELECT value FROM tmp_table WHERE id = 1; ERROR 1064 (HY000): Backend node not found. Check if any backend node is down.backend: [strsent-ksfebl-be-0.strsent-ksfebl-be-headless.default.svc.cluster.local alive: false inBlacklist: false] [strsent-ksfebl-be-1.strsent-ksfebl-be-headless.default.svc.cluster.local alive: true inBlacklist: false]



**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.
iziang commented 4 days ago

We focuses on the shared-data architecture, with a lower priority on the shared-nothing architecture. It does not yet support scaling down BE nodes.