Overview
ls_gc_delay_time specifies the time before a tenant's log stream is deleted.
The load balancing module is designed and implemented based on the log stream splitting and merging features, providing capabilities such as scaling up and down. When a database undergoes a scale-down operation, log streams that meet the Garbage Collection (GC) criteria are promptly deleted, and the system also cleans up the corresponding log storage for Palf.
Furthermore, network-based physical standby databases have been implemented. In this architecture, if log archiving is not enabled for the primary or standby tenant at the source and a database scale-down operation is performed, the log stream will be cleared up quickly. This can easily cause the overall log synchronization to stall due to the reclamation of source logs. Therefore, this parameter is used to configure the time before the log stream is deleted with a delay for the primary or standby tenant at the source.
Privilege requirements
Query parameters
Both the
systenant and all user tenants can query this parameter using theSHOW PARAMETERSstatement or theGV$OB_PARAMETERSview.Modify parameters
Both the
systenant and user tenants can modify this parameter.
Attributes
Attribute |
Description |
|---|---|
| Parameter type | Time |
| Default Value | 0s indicates that the delayed log stream deletion mechanism is no longer effective. |
| Value range | [0s,+∞) |
| Modifiable | Yes, you can use theALTER SYSTEM SETStatement modification. |
| Whether to restart the OBServer node for the change to take effect | No, the setting takes effect immediately. |
Usage instructions
For physical standby database scenarios:
If log archiving is not enabled for the primary or standby tenant at the source, and the default value of the
ls_gc_delay_timeparameter is 3600s, which is 1 hour, the log delayed deletion mechanism takes effect, and log streams are delayed for deletion for 1 hour.If log archiving is enabled for the primary or standby tenant at the source, the integrity of log stream data is guaranteed by log archiving. Therefore, the GC of the log stream is not affected by this parameter. That is, in this scenario, the log delay deletion mechanism does not take effect regardless of the value of the
ls_gc_delay_timeparameter.
For tenant deletion scenarios, the log stream delayed deletion mechanism does not take effect regardless of the value of the
ls_gc_delay_timeparameter.Notice
The delayed deletion in this parameter only retains the log stream entity. Whether the log files of the log stream itself can be retained depends on the remaining disk space of the current tenant. If the remaining disk space is insufficient, log recycling will still be triggered.
Configuration example
Set the delay before log streams of a specified tenant are deleted in the sys tenant.
obclient> ALTER SYSTEM SET ls_gc_delay_time='7200s' TENANT = 'mysql_tenant';Users can set the delay before log streams of a tenant are deleted.
obclient> ALTER SYSTEM SET ls_gc_delay_time='7200s';