radondb / radondb-mysql-kubernetes

Open Source,High Availability Cluster,based on MySQL
Apache License 2.0
354 stars 83 forks source link

【bug】Sysbench writes data and removes the slave node POD mysql container,the master/slave relationship is broken #626

Closed qianfen2021 closed 2 years ago

qianfen2021 commented 2 years ago

Describe the problem Sysbench writes data and removes the slave node POD mysql container,the master/slave relationship is broken

the error as follows: [ERROR] FOLLOWER[ID:sample-mysql-0.sample-mysql.default:8801, V:35, E:0].mysql.StartSlave.error[Error 1200: The server is not configured as slave; fix in config file or with CHANGE MASTER TO]

sysbench command as follows: sysbench --mysql-host=sample-leader.default --mysql-port=3306 --mysql-user=radondb_usr --mysql-password=RadonDB@123 --mysql-db=radondb --threads=64 --time=300 --report-interval=10 --tables=64 --table-size=50000 oltp_write_only.lua run

the yaml as follows:

spec:
  backupScheduleJobsHistoryLimit: 6
  metricsOpts:
    enabled: false
    image: 'prom/mysqld-exporter:v0.12.1'
    resources:
      limits:
        cpu: 100m
        memory: 128Mi
      requests:
        cpu: 10m
        memory: 32Mi
  minAvailable: 50%
  mysqlOpts:
    database: radondb
    initTokuDB: false
    password: RadonDB@123
    resources:
      limits:
        cpu: 4
        memory: 8Gi
      requests:
        cpu: 2
        memory: 4Gi
    rootHost: localhost
    rootPassword: ''
    user: radondb_usr
  mysqlVersion: '8.0'
  persistence:
    accessModes:
      - ReadWriteOnce
    enabled: true
    size: 20Gi
  podPolicy:
    affinity: {}
    auditLogTail: false
    busyboxImage: 'busybox:1.32'
    extraResources:
      requests:
        cpu: 10m
        memory: 32Mi
    imagePullPolicy: IfNotPresent
    sidecarImage: 'radondb/mysql80-sidecar:v2.2.1-alpha.3'
    slowLogTail: false
  replicas: 3
  xenonOpts:
    admitDefeatHearbeatCount: 5
    electionTimeout: 10000
    enableAutoRebuild: true
    image: 'radondb/xenon:v2.2.1-alpha.3'
    resources:
      limits:
        cpu: 100m
        memory: 256Mi
      requests:
        cpu: 50m
        memory: 128Mi

To Reproduce

1.Sysbench writes data 2.removes the slave node POD mysql container

Expected behavior

Environment:

acekingke commented 2 years ago

remove the container has this bug, if xenoncli raft disable and then xenoncli raft enable` , it can fix this problem.