Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]Table 'oceanbase.__all_virtual_tenant_parameter_stat' doesn't exist for oceanbase stand-alone #6079

Closed
ahjing99 opened this issue Dec 13, 2023 · 3 comments
Assignees
Labels
bug kind/bug Something isn't working
Milestone

Comments

@ahjing99
Copy link
Collaborator

➜ ~ kbcli version
Kubernetes: v1.27.3-gke.100
KubeBlocks: 0.7.2-beta.20
kbcli: 0.7.2-beta.20

  1. Stand-alone oceanbase return error when SHOW PARAMETERS
 `kbcli addon enable oceanbase `

addon.extensions.kubeblocks.io/oceanbase enabled

apiVersion: apps.kubeblocks.io/v1alpha1
kind: Cluster
metadata:
  name: ocbase-ghrlvk
  namespace: default
  annotations:
    "kubeblocks.io/extra-env": '{"TENANT_NAME":"tenat0","TENANT_CPU":"2","TENANT_MEMORY":"2G","TENANT_DISK":"5G","ZONE_COUNT":"0","OB_CLUSTERS_COUNT":"1"}'
spec:
  clusterDefinitionRef: oceanbase
  clusterVersionRef: oceanbase-4.2.0.0-100010032023083021
  terminationPolicy: WipeOut
  componentSpecs:
    - name: ob-bundle
      componentDefRef: ob-bundle
      replicas: 1
      resources:
        requests:
          cpu: 2000m
          memory: 8Gi
        limits:
          cpu: 2000m
          memory: 8Gi
      volumeClaimTemplates:
        - name: data-file
          spec:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: "50Gi"
        - name: data-log
          spec:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: "50Gi"
        - name: log
          spec:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: "10Gi"

      `kubectl apply -f test_create_ocbase-ghrlvk.yaml`

➜  ~ kbcli cluster connect ocbase-ghrlvk
Connect to instance ocbase-ghrlvk-ob-bundle-0: out of ocbase-ghrlvk-ob-bundle-0, ocbase-ghrlvk-ob-bundle-1
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3221225497
Server version: 5.7.25 OceanBase_CE 4.2.0.0 (r100010032023083021-7e912e012b5f2036b79eaeecaaf59884efc184fd) (Built Aug 30 2023 21:30:23)

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SHOW PARAMETERS LIKE '%syslog_level%';
ERROR 1146 (42S02): Table 'oceanbase.__all_virtual_tenant_parameter_stat' doesn't exist
  1. Primary /secondary oceanbase works
apiVersion: apps.kubeblocks.io/v1alpha1
kind: Cluster
metadata:
  name: ocbase-ghrlvk
  namespace: default
  annotations:
    "kubeblocks.io/extra-env": '{"TENANT_NAME":"tenat1","TENANT_CPU":"2","TENANT_MEMORY":"2G","TENANT_DISK":"5G","ZONE_COUNT":"1","OB_CLUSTERS_COUNT":"3"}'
spec:
  clusterDefinitionRef: oceanbase
  clusterVersionRef: oceanbase-4.2.0.0-100010032023083021
  terminationPolicy: Delete
  affinity:
    podAntiAffinity: Required
    topologyKeys:
      - kubernetes.io/hostname
    tenancy: SharedNode
  componentSpecs:
    - name: ob-bundle-0
      componentDefRef: ob-bundle
      replicas: 1
      resources:
        requests:
          cpu: 2000m
          memory: 8Gi
        limits:
          cpu: 2000m
          memory: 8Gi
      volumeClaimTemplates:
        - name: data-file
          spec:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: "50Gi"
        - name: data-log
          spec:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: "50Gi"
        - name: log
          spec:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: "10Gi"
    - name: ob-bundle-1
      componentDefRef: ob-bundle
      replicas: 1
      resources:
        requests:
          cpu: 2000m
          memory: 8Gi
        limits:
          cpu: 2000m
          memory: 8Gi
      volumeClaimTemplates:
        - name: data-file
          spec:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: "50Gi"
        - name: data-log
          spec:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: "50Gi"
        - name: log
          spec:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: "10Gi"

      `kubectl apply -f test_create_ocbase-ghrlvk.yaml`

➜  ~ kbcli cluster connect ocbase-ghrlvk
Connect to instance ocbase-ghrlvk-ob-bundle-0-0
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3221225477
Server version: 5.7.25 OceanBase_CE 4.2.0.0 (r100010032023083021-7e912e012b5f2036b79eaeecaaf59884efc184fd) (Built Aug 30 2023 21:30:23)

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SHOW PARAMETERS LIKE '%syslog_level%';
ERROR 4012 (HY000): Timeout, query has reached the maximum query timeout: 10000000(us), maybe you can adjust the session variable ob_query_timeout or query_timeout hint, and try again.
mysql> SHOW PARAMETERS LIKE '%syslog_level%';
+-------+----------+-------------+----------+--------------+-----------+-------+------------------------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+
| zone  | svr_type | svr_ip      | svr_port | name         | data_type | value | info                                                                                                                         | section  | scope   | source  | edit_level        |
+-------+----------+-------------+----------+--------------+-----------+-------+------------------------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+
| zone0 | observer | 10.104.2.11 |     2882 | syslog_level | NULL      | DEBUG | specifies the current level of logging. There are DEBUG, TRACE, WDIAG, EDIAG, INFO, WARN, ERROR, seven different log levels. | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
+-------+----------+-------------+----------+--------------+-----------+-------+------------------------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+
1 row in set (1.85 sec)
@ahjing99 ahjing99 added the kind/bug Something isn't working label Dec 13, 2023
@shanshanying
Copy link
Contributor

shanshanying commented Dec 13, 2023

StandAlone Mode:

  1. zone = 1, replica = 1, obcluster = 1

Primary-Secondary Mode:

  1. zone = 1, replica = 1, obcluster = 2

Distributed Mode;

  1. zone = 3, replica = 3, obcluster =1, where replica could be any value withreplica >zone

@shanshanying
Copy link
Contributor

shanshanying commented Dec 13, 2023

When "TENANT_NAME":"tenat0" is set, we should check tenants are created:
connect to any node in zone, and

SELECT TENANT_NAME, TENANT_TYPE, CREATE_TIME, STATUS, TENANT_ROLE FROM oceanbase.DBA_OB_TENANTS WHERE TENANT_NAME = 'tenant0';

Under primary-secondary, the role is primary and standby seperately.

@ahjing99
Copy link
Collaborator Author

After change the zone to 1, the problem is fixed, closing the issue

@github-actions github-actions bot added this to the Release 0.8.0 milestone Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants