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
- Template: ${alarm_target} ${alarm_name}
- Example: ob_cluster=C1-1000:tenant_name=T1. No major compaction has been performed for the OceanBase Database tenant for a long time.
- Alert details
- Template: Cluster: ${ob_cluster_name}. Tenant: ${tenant_name}. Alert: ${alarm_name}. The time since the last major compaction is ${value_shown} seconds, which exceeds ${alarm_threshold} seconds.
- Example: Cluster: obcluster. Tenant: T1. Alert: No major compaction has been performed for the OceanBase Database tenant for a long time. The time since the last major compaction is 216000 seconds, which exceeds 108000 seconds.
- Alert recovery
- Template: Alert: ${alarm_name}. The time since the last major compaction for the OceanBase tenant is ${value_shown}.
- Example: Alert: No major compaction has been performed for the OceanBase tenant for a long time. The time since the last major compaction for the OceanBase tenant is 9560 seconds.
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.