A major compaction can be automatically triggered.
Prerequisites
To enable the system to automatically trigger a major compaction, make sure that global major compaction is enabled. Global major compaction is controlled by the cluster-level parameter enable_major_freeze. The default value is True, which specifies to enable global major compaction.
If global major compaction is disabled for the current cluster, perform the following steps to enable this feature:
Log in to the
systenant of the cluster as therootuser.Verify whether global major compaction is enabled.
obclient> SHOW PARAMETERS LIKE 'enable_major_freeze';If global major compaction is not enabled, execute the following statement to enable the feature:
obclient> ALTER SYSTEM SET enable_major_freeze='True';For more information about the
enable_major_freezeparameter, see enable_major_freeze.
Conditions for automatically triggering a major compaction
A major compaction is automatically triggered if the active MemStore memory used by a tenant reaches the value specified by freeze_trigger_percentage * memstore_limit (where memstore_limit = tenant memory * memstore_limit_percentage), and the number of minor compactions reaches the value of the major_compact_trigger parameter.
For more information about the freeze_trigger_percentage and major_compact_trigger parameters, see Modify minor compaction settings.