This topic describes the following two metrics related to partitions in an OceanBase Database tenant : leader_absent_count and replica_absent_count. You can specify a statistical range to query the metrics in a single zone or on a single OBServer node for a tenant.
leader_absent_count
Definition
The number of leaderless partitions in a tenant within the specified statistical range.
Description
| Metric | Metric name | Unit |
|---|---|---|
| leader_absent_count | tenant_partition_leader_absent_count | N/A |
Calculation expression
max(partition_leader_absent_count{@LABELS}) by (@GBLABELS)
SQL statements for metric collection
SELECT /*+ MONITOR_AGENT QUERY_TIMEOUT(20000000) */ tenant.tenant_id, tenant.tenant_name, IFNULL(stat.cnt, 0) cnt FROM __all_tenant tenant LEFT JOIN (SELECT /*+QUERY_TIMEOUT(20000000)*/ tenant.tenant_id, count(distinct a.table_id,a.partition_id) cnt FROM __all_tenant tenant JOIN __all_virtual_meta_table a ON a.tenant_id=tenant.tenant_id LEFT JOIN __all_virtual_meta_table b ON a.table_id=b.table_id AND a.partition_id=b.partition_id AND b.role=1 WHERE b.tenant_id IS NULL GROUP BY tenant.tenant_id) stat ON stat.tenant_id=tenant.tenant_id
replica_absent_count
Definition
The number of partitions lacking replicas in a tenant within the specified statistical range.
Description
| Metric | Metric name | Unit |
|---|---|---|
| replica_absent_count | tenant_partition_replica_absent_count | N/A |
Calculation expression
max(partition_replica_absent_count{@LABELS}) by (@GBLABELS)
SQL statements for metric collection
SELECT /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) QUERY_TIMEOUT(20000000) */ tenant.tenant_id, tenant.tenant_name, IFNULL(stat.cnt, 0) cnt FROM __all_tenant tenant LEFT JOIN (SELECT table_id>>40 AS tenant_id, COUNT(1) cnt FROM __all_virtual_election_info WHERE member_list NOT LIKE CONCAT(replica_num,'{%') AND SUBSTR(member_list, 1, 1) != '0' GROUP BY tenant_id) stat ON tenant.tenant_id=stat.tenant_id where stat.tenant_id not in (select tenant_id from __all_rootservice_job where job_type='ALTER_TENANT_LOCALITY' and job_status='INPROGRESS')