Collect information about the major compaction status of zones of a cluster

2025-03-26 07:47:21  Updated

Description

You can query the major compaction status of zones of a cluster.

Statement

OceanBase Database of a version earlier than V4.0.0:

SELECT zone, info as status, gmt_modified from __all_zone WHERE name='merge_status' AND zone != '';

OceanBase Database V4.0.0 and later:

SELECT c.TENANT_ID tenant_id, t.tenant_name, c.ZONE zone, c.STATUS status, c.LAST_FINISH_TIME, c.IS_ERROR, c.INFO
FROM CDB_OB_ZONE_MAJOR_COMPACTION c
INNER JOIN __all_tenant t ON c.tenant_id=t.tenant_id;

Troubleshooting method

You can check for major compaction status values other than IDLE. The status values are described as follows:

  • IDLE: No major compaction is in progress.
  • ERROR: An error occurred during the major compaction.
  • TIMEOUT: The major compaction timed out but is not suspended. Only a TIMEOUT flag is attached.
  • MERGING: A major compaction is in progress.

For the row whose value in the STATUS column is IDLE, the value in the gmt_modified column indicates the time when the major compaction was last completed.

Contact Us