You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/concepts/configuration/configuration_persistence.rst
+54-34Lines changed: 54 additions & 34 deletions
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,8 @@ that takes a new snapshot every ``snapshot.by.interval`` seconds.
41
41
If the ``snapshot.by.interval`` option is set to zero, the checkpoint daemon is disabled.
42
42
43
43
The ``snapshot.by.wal_size`` option defines the maximum size in bytes for of all WAL files created since the last snapshot taken.
44
-
Once this size is exceeded, the checkpoint daemon takes a snapshot and deletes the old WAL files.
44
+
Once this size is exceeded, the checkpoint daemon takes a snapshot. Then, :ref:`Tarantool garbage collector <configuration_persistence_garbage_collector>`
45
+
deletes the old WAL files.
45
46
46
47
The example shows how to specify the ``snapshot.by.interval`` and the ``snapshot.by.wal_size`` options:
47
48
@@ -51,25 +52,6 @@ The example shows how to specify the ``snapshot.by.interval`` and the ``snapshot
51
52
:end-at: 1000000000000000000
52
53
:dedent:
53
54
54
-
.. _configuration_persistence_snapshot_count:
55
-
56
-
Configure a maximum number of stored snapshots
57
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
58
-
59
-
You can set a limit on the number of snapshots stored in the :ref:`snapshot.dir <configuration_reference_snapshot_dir>`
60
-
directory using the :ref:`snapshot.count <configuration_reference_snapshot_count>` option.
61
-
When the number of snapshots in the directory reaches the limit,
62
-
the checkpoint daemon activates Tarantool garbage collector after the new snapshot is taken.
63
-
Tarantool garbage collector deletes the oldest snapshot file and any associated WAL files, after the new snapshot is taken.
If necessary, the checkpoint daemon also activates the Tarantool garbage collector that deletes old snapshot and WAL files.
220
+
The checkpoint daemon creates a schedule for the periodic snapshot creation based on
221
+
the :ref:`configuration options <configuration_reference_snapshot_by>`and the speed of file size growth.
222
+
If enabled, the daemon makes new snapshots (.snap) files according to this schedule.
223
+
224
+
The work of checkpoint daemon is based on the following configuration options:
225
+
226
+
* :ref:`snapshot.by.interval <configuration_reference_snapshot_by_interval>` -- a new snapshot is taken once in a given period.
227
+
* :ref:`snapshot.by.wal_size <configuration_reference_snapshot_by_wal_size>` -- a new snapshot is taken once the size
228
+
of all WAL files created since the last snapshot exceeds a given limit.
229
+
230
+
If necessary, the checkpoint daemon also activates the :ref:`Tarantool garbage collector <configuration_persistence_garbage_collector>` that deletes old snapshot and WAL files.
215
231
216
232
.. _configuration_persistence_garbage_collector:
217
233
218
234
Tarantool garbage collector
219
235
---------------------------
220
236
237
+
Tarantool garbage collector can be activated by the :ref:`checkpoint daemon <configuration_persistence_checkpoint_daemon>`.
238
+
The garbage collector tracks the snapshots that are to be :ref:`relayed to a replica <memtx-replication>` or needed
239
+
by other consumers. When the files are no longer needed, Tarantool garbage collector deletes them.
240
+
221
241
.. NOTE::
222
242
223
-
The garbage collector called by the checkpoint daemon, is distinct from the `Lua garbage collector <https://www.lua.org/manual/5.1/manual.html#2.10>`_
243
+
The garbage collector called by the checkpoint daemon, is distinct from the `Lua garbage collector <https://www.lua.org/manual/5.1/manual.html#2.10>`_
224
244
which is for Lua objects, and distinct from the Tarantool garbage collector that specializes in :ref:`handling shard buckets <vshard-gc>`.
225
245
226
246
This garbage collector is called as follows:
227
247
228
248
* When the number of snapshots reaches the limit of :ref:`snapshot.count <configuration_reference_snapshot_count>` size.
229
249
After a new snapshot is taken, Tarantool garbage collector deletes the oldest snapshot file and any associated WAL files.
230
250
231
-
* When the size all WAL files created since the last snapshot reaches the limit of :ref:`snapshot.by.wal_size <configuration_reference_snapshot_by_wal_size>`.
251
+
* When the size of all WAL files created since the last snapshot reaches the limit of :ref:`snapshot.by.wal_size <configuration_reference_snapshot_by_wal_size>`.
232
252
Once this size is exceeded, the checkpoint daemon takes a snapshot, then the garbage collector deletes the old WAL files.
233
253
234
-
If the checkpoint daemon deletes an old snapshot file, the Tarantool garbage collector also deletes
254
+
If an old snapshot filen is deleted, the Tarantool garbage collector also deletes
235
255
any :ref:`write-ahead log (.xlog) <internals-wal>` files that meet the following conditions:
236
256
237
257
* The WAL files are older than the snapshot file.
238
258
* The WAL files contain information present in the snapshot file.
239
259
240
260
Tarantool garbage collector also deletes obsolete vinyl ``.run`` files.
241
261
242
-
The checkpoint daemon and the Tarantool garbage collector don't delete a file in the following cases:
262
+
Tarantool garbage collector doesn't delete a file in the following cases:
243
263
244
264
* A **backup** is running, and the file has not been backed up
245
265
(see :ref:`"Hot backup" <admin-backups-hot_backup_vinyl_memtx>`).
0 commit comments