Description
OceanBase Database V4.0 and later support major compactions of a tenant. If a major compaction is not performed for a tenant in the specified threshold period of time since the last major compaction, this alert is triggered.
Principle
| Parameter | Value |
|---|---|
| Metric | no_compaction_seconds |
| Source | Internal views. SQL statements for metric collection: select tenant_id, time_to_usec(start_time) as start_time, time_to_usec(now()) as current from CDB_OB_MAJOR_COMPACTION |
| Collected metric | ob_compaction_current_timestamp,ob_compaction_start_time |
| Metric expression | (max(ob_compaction_current_timestamp{@LABELS}) by (@GBLABELS) - max(ob_compaction_start_time{@LABELS}) by (@GBLABELS)) / 1000000 |
| Collection cycle | 1 minute |
Alert rule
| Metric expression | Metric description | Default threshold | Detection cycle | Time before clearance |
|---|---|---|---|---|
| no_compaction_seconds > 108000 | The time elapsed since the last major compaction of a tenant, in seconds. | 108000 (30 hours) | 60 seconds | 5 minutes |
Alert information
| Trigger method | Alert level | Scope |
|---|---|---|
| Based on the expression of the metric | Critical | Tenant |
Alert templates
- Alert overview: ${alarm_target} ${alarm_name}
- Alert details: Cluster: ${ob_cluster_name}. Tenant: ${tenant_name}. Alert: ${alarm_name}
- Overview example: ob_cluster=C1-1000:tenant_name=T1. No major compaction has been performed for the OceanBase Database tenant for a long time.
- Details example: Cluster: obcluster. Tenant: T1. Alert: No major compaction has been performed for the OceanBase Database tenant for a long time.
Impact on the system
If no major compaction or minor compaction is performed for the tenant for a long time, the disk usage increases, causing the disk space to be fully used and affecting writes of the application system.
Possible causes
The Root Service is suspended because the OceanBase cluster is leaderless or the process is suspended due to an exception.
Solutions
The solution is the same as that for the ob_cluster_no_frozen alert.