Note
This parameter is available starting with V4.2.0.
Description
ls_gc_delay_time specifies the time before log streams in a tenant are garbage-collected.
OceanBase Database V4.2.0 introduced load balancing based on log stream splitting and compaction. This enables the database to scale up or down. When you scale down the database, log streams meeting the garbage collection (GC) conditions are deleted, and the corresponding Palf log storage is also cleared.
In addition, OceanBase Database V4.2.0 introduced physical standby databases based on a network. When the source primary or standby tenant does not have log archiving enabled and you scale down the database, the log streams are quickly cleared. This can easily cause the log synchronization of the standby tenant to become stuck due to the source tenant's log recycling. To avoid this, you can set this parameter to specify the delay time for log stream deletion in the source primary or standby tenant.
Privilege requirements
Query the parameter
systenants and user tenants can query this parameter by using theSHOW PARAMETERSstatement or theGV$OB_PARAMETERSview.Modify the parameter
systenants and user tenants can modify this parameter.
Attributes
| Attribute | Description |
|---|---|
| Type | Time |
| Default value | 0 s, which indicates that the delayed log stream deletion feature is not in effect.
NoteFrom V4.2.1 BP1, the default value was changed from 3600 s to 0 s. |
| 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 log archiving is not enabled in the source primary or standby tenant and the default value of the
ls_gc_delay_timeparameter is 3600 s (1 hour), the log stream delayed deletion feature is effective. The log streams are deleted after a delay of 1 hour.If log archiving is enabled in the source primary or standby tenant, the log stream GC is not affected by this parameter. In this case, no matter what the value of the
ls_gc_delay_timeparameter is, the log stream delayed deletion feature is not effective.
In a tenant deletion scenario, no matter what the value of the
ls_gc_delay_timeparameter is, the log stream delayed deletion feature is not effective.Notice
The log stream delayed deletion feature only retains the log stream entities. The retention of log files in the log streams is determined by the remaining disk space of the current tenant. If the disk space is insufficient, log recycling will still be triggered.
Examples
Set the delay time of log streams for a specified tenant in the
systenant.obclient> ALTER SYSTEM SET ls_gc_delay_time='7200s' TENANT = 'mysql_tenant';Set the delay time of log streams for the user tenant.
obclient> ALTER SYSTEM SET ls_gc_delay_time='7200s';
