Skip to content

Commit 3502840

Browse files
Document wal.retention_period (#4399)
1 parent d3ad4f2 commit 3502840

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

doc/reference/configuration/configuration_reference.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4660,6 +4660,7 @@ To learn more about the WAL configuration, check the :ref:`Persistence <configur
46604660
- :ref:`wal.max_size <configuration_reference_wal_max_size>`
46614661
- :ref:`wal.mode <configuration_reference_wal_mode>`
46624662
- :ref:`wal.queue_max_size <configuration_reference_wal_queue_max_size>`
4663+
- :ref:`wal.retention_period <configuration_reference_wal_retention_period>`
46634664
- :ref:`wal.ext.* <configuration_reference_wal_ext>`
46644665

46654666
.. _configuration_reference_wal_cleanup_delay:
@@ -4680,6 +4681,8 @@ To learn more about the WAL configuration, check the :ref:`Persistence <configur
46804681
The option has no effect on nodes running as
46814682
:ref:`anonymous replicas <configuration_reference_replication_anon>`.
46824683

4684+
See also: :ref:`wal.retention_period <configuration_reference_wal_retention_period>`
4685+
46834686
|
46844687
| Type: number
46854688
| Default: 14400
@@ -4768,6 +4771,36 @@ To learn more about the WAL configuration, check the :ref:`Persistence <configur
47684771
| Default: 16777216
47694772
| Environment variable: TT_WAL_QUEUE_MAX_SIZE
47704773
4774+
.. _configuration_reference_wal_retention_period:
4775+
4776+
.. confval:: wal.retention_period
4777+
4778+
**Since:** :doc:`3.1.0 </release/3.1.0>` (`Enterprise Edition <https://www.tarantool.io/compare/>`_ only)
4779+
4780+
The delay in seconds used to prevent the :ref:`Tarantool garbage collector <configuration_persistence_checkpoint_daemon>` from removing a :ref:`write-ahead log <internals-wal>` file after it has been closed.
4781+
If a node is restarted, ``wal.retention_period`` counts down from the last modification time of the write-ahead log file.
4782+
4783+
The garbage collector doesn't track write-ahead logs that are to be :ref:`relayed <memtx-replication>` to anonymous replicas, such as:
4784+
4785+
* Anonymous replicas added as a part of a cluster configuration (see :ref:`replication.anon <configuration_reference_replication_anon>`).
4786+
* CDC (Change Data Capture) that retrieves data using anonymous replication.
4787+
4788+
In case of a replica or CDC downtime, the required write-ahead logs can be removed.
4789+
As a result, such a replica needs to be rebootstrapped.
4790+
You can use ``wal.retention_period`` to prevent such issues.
4791+
4792+
Note that :ref:`wal.cleanup_delay <configuration_reference_wal_cleanup_delay>` option also sets the delay used to prevent the Tarantool garbage collector from removing write-ahead logs.
4793+
The difference is that the garbage collector doesn't take into account ``wal.cleanup_delay`` if all the nodes in the replica set are up and running, which may lead to the removal of the required write-ahead logs.
4794+
4795+
.. NOTE::
4796+
4797+
:ref:`box.info.gc().wal_retention_vclock <box_info_gc>` can be used to get a vclock value of the oldest write-ahead log protected by ``wal.retention_period``.
4798+
4799+
|
4800+
| Type: number
4801+
| Default: 0
4802+
| Environment variable: TT_WAL_RETENTION_PERIOD
4803+
47714804
.. _configuration_reference_wal_ext:
47724805

47734806
wal.ext.*

doc/reference/reference_lua/box_info/gc.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ box.info.gc()
2222
* **gc().checkpoints[n].signature** -- a sum of a checkpoint's vclock's components.
2323
* **gc().checkpoint_is_in_progress** -- true if a checkpoint is in progress, otherwise false
2424
* **gc().vclock** -- the garbage collector's vclock.
25-
* **gc().signature** -- the sum of the garbage collector's checkpoint's components.
25+
* **gc().signature** -- the sum of the garbage collector's checkpoint's components.
26+
* **gc().wal_retention_vclock** -- a vclock value of the oldest write-ahead log file protected from removing by the garbage collector by using the :ref:`wal.retention_period <configuration_reference_wal_retention_period>` option.

0 commit comments

Comments
 (0)