Note
This parameter is introduced since OceanBase Database V4.2.0.
ls_gc_delay_time specifies the time lag before the log stream of a tenant is deleted.
OceanBase Database V4.2.0 and later provide load balancing modules for scaling capabilities based on log stream splitting and merging. When you scale in an OceanBase database, the system quickly deletes the log streams that meet the garbage collection (GC) conditions, and clears the log storage of Palf.
OceanBase Database V4.2.0 and later also implement the network-based Physical Standby Database architecture. In the Physical Standby Database architecture, if log archiving is not enabled for the source primary tenant or standby tenant, the log streams will be cleaned up soon after the database is scaled in. This tends to block the log synchronization of the standby tenant due to the cleanup of logs of the source. Therefore, it is necessary to delay the deletion of the log streams in the source primary tenant or standby tenant.
| Attribute | Description |
|---|---|
| Type | Time |
| Default value | 3600s. If you set this parameter to 0s, the deletion of log streams is not delayed. |
| Value range | [0s, +∞) |
| Effective upon OBServer node restart | No |
Take note of the following considerations:
In the Physical Standby Database architecture:
If log archiving is disabled for the source primary tenant or standby tenant and
ls_gc_delay_timeis set to the default value 3600s, the log stream deletion is delayed for 1 hour.If log archiving is enabled for the source primary tenant or standby tenant, which ensures the data integrity of the log streams, the GC of the log streams is not affected by this parameter. In other words, log deletion is not delayed regardless of the value of
ls_gc_delay_time.
When a tenant is deleted, log deletion is not delayed regardless of the value of
ls_gc_delay_time.
Notice
In the delayed deletion of a log stream, the log stream instance is retained. Whether the log files contained in the log stream are retained depends on the available disk space of the tenant. If the remaining disk space is insufficient, log recycling is triggered to recycle the log files.
Examples
Execute the following statement in the
systenant to set the lag of log stream deletion for a specific tenant:ALTER SYSTEM SET ls_gc_delay_time='7200s' TENANT = 'mysql_tenant';Execute the following statement in a user tenant to set the lag of log stream deletion for the tenant:
ALTER SYSTEM SET ls_gc_delay_time='7200s';