Note
This parameter is available starting with V4.2.0.
Description
ls_gc_delay_time specifies the time for delaying the deletion of log streams in a tenant.
OceanBase Database V4.2.0 introduces the load balancing module based on log stream splitting and merging. This module provides capabilities such as scaling out and scaling in. When you scale in the database, log streams that meet the garbage collection (GC) conditions are quickly deleted, and the system also clears the corresponding log storage of the Palf.
In addition, OceanBase Database V4.2.0 introduces physical standby databases based on the network. In this architecture, when the source primary or standby tenant has not enabled log archiving, and you scale in the database, the log streams are quickly cleared. This can easily cause the log synchronization to be blocked due to the log recycling of the source tenant. Therefore, you can use this parameter to specify the time for delaying the deletion of log streams in the source primary or standby tenant.
Privilege requirements
Query the parameter
The
systenant and all user tenants can use theSHOW PARAMETERSstatement or theGV$OB_PARAMETERSview to query this parameter.Modify the parameter
The
systenant and user tenants can modify this parameter.
Attributes
| Attribute | Description |
|---|---|
| Parameter type | Time |
| Default value | 0s, indicating that the delayed deletion of log streams is no longer effective.
NoteStarting from V4.2.1 BP1, the default value is changed from 3600s to 0s. |
| Value range | [0s, +∞) |
| Modifiable | Yes. You can use the ALTER SYSTEM SET statement to modify the parameter. |
| Effective upon OBServer node restart | No. The setting takes effect immediately. |
Considerations
In the physical standby database scenario:
If the source primary or standby tenant has not enabled log archiving, and the default value of the
ls_gc_delay_timeparameter is 3600s (1 hour), the delayed deletion of log streams is effective, and the time for delaying the deletion of log streams is 1 hour.If the source primary or standby tenant has enabled log archiving, the log stream data is guaranteed to be complete. Therefore, the GC of log streams is not affected by this parameter. In this case, the delayed deletion of log streams is not effective regardless of the value of the
ls_gc_delay_timeparameter.
In the tenant deletion scenario, the delayed deletion of log streams is not effective regardless of the value of the
ls_gc_delay_timeparameter.Notice
The delayed deletion of log streams only retains the log stream entities. Whether the log files of the log streams can be retained depends on the remaining disk space of the current tenant. If the remaining disk space is insufficient, the log recycling is still triggered.
Examples
Set the time for delaying the deletion of log streams in a specified tenant under the
systenant.obclient> ALTER SYSTEM SET ls_gc_delay_time='7200s' TENANT = 'mysql_tenant';Set the time for delaying the deletion of log streams in the current user tenant.
obclient> ALTER SYSTEM SET ls_gc_delay_time='7200s';