Description
OceanBase Database V4.0 and later support minor compactions of a tenant. If a minor compaction is not performed for a tenant in the specified threshold period of time since the last minor compaction, this alert is triggered.
Principle
| Parameter | Value |
|---|---|
| Metric | no_frozen_seconds |
| Source | Internal views. SQL statements for metric collection: select tenant_id, time_to_usec(frozen_time) as frozen_time, time_to_usec(now()) as current from CDB_OB_MAJOR_COMPACTION |
| Collected metric | ob_compaction_current_timestamp,ob_compaction_frozen_time |
| Metric expression | (max(ob_compaction_current_timestamp{@LABELS}) by (@GBLABELS) - max(ob_compaction_frozen_time{@LABELS}) by (@GBLABELS)) / 1000000 |
| Collection cycle | 1 minute |
Alert rule
| Metric expression | Metric description | Default threshold | Detection cycle | Time before clearance |
|---|---|---|---|---|
| no_frozen_seconds > 90000 | The time elapsed since the last minor compaction of a tenant, in seconds. | 90000 (25 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 minor 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 freeze is ${value_shown} seconds, which is more than ${alarm_threshold} seconds.
- Example: Cluster: obcluster. Tenant: T1. Alert: No minor compaction has been performed for the OceanBase Database tenant for a long time. The time since the last freeze is 130000 seconds, which is more than 90000 seconds.
- Alert recovery
- Template: Alert: ${alarm_name}. The time since the last freeze is ${recover_value} seconds.
- Example: Alert: No minor compaction has been performed for the OceanBase Database tenant for a long time. The time since the last freeze is 8600 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 daily major compaction feature is disabled or the upgrade mode parameter is enabled.
- The Root Service is suspended because the OBServer 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.