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
When object retention lock is enabled on a backup task, ScyllaDB Manager applies object-level retention
20
23
to all snapshot files from given backup task execution. This includes schema files, SSTable files,
21
24
and manifest files. The retention lock is applied during dedicated stage (``RETENTION_LOCK``) that
22
25
runs after backup is finalized and all snapshot files are already in backup location.
@@ -27,14 +30,51 @@ contained in the snapshot tag, and lasts for the specified retention days.
27
30
This means that a snapshot with ``--retention-days 30`` will have its files protected for exactly 30 days
28
31
from when the snapshot was taken, regardless of how long the backup task takes to complete.
29
32
33
+
This approach results in making a per-file request for both newly uploaded and deduplicated files.
34
+
When making highly deduplicated backups to a colder storage tier (low storage costs, high request costs),
35
+
consider using ``event-based-hold`` mode which avoids making additional requests for deduplicated files.
36
+
37
+
Event based hold mode (``event-based-hold``)
38
+
--------------------------------------------
39
+
40
+
This mode utilizes the following cloud provider features for protecting snapshot files:
41
+
42
+
* `Default bucket event based holds <https://docs.cloud.google.com/storage/docs/object-holds#default-holds>`_ - uploaded
43
+
objects have event based hold set. This hold needs to be removed before protected object can be deleted.
44
+
* `Bucket retention lock <https://docs.cloud.google.com/storage/docs/bucket-lock>`_ - removing event based hold from an
45
+
object starts specified retention period during which the object can't be deleted.
46
+
47
+
ScyllaDB Manager utilizes those bucket features in the following way:
48
+
49
+
* Newly uploaded snapshot files automatically have event based hold applied.
50
+
* Deduplicated snapshot files keep their hold.
51
+
* Files referenced by previous snapshot which are not a part of the current one have their event based holds released. This starts their retention period.
52
+
53
+
The retention period is configured via bucket configuration, not the ``--retention-days`` or ``--retention`` flags.
54
+
ScyllaDB Manager won't attempt to purge stale snapshots according to backup task retention policy,
55
+
if they are still protected by either event based holds or already started retention period.
56
+
57
+
The main benefit of this approach is that it makes only a single per-file request and does not repeat those requests for deduplicated files.
58
+
When making highly deduplicated backups to a colder storage tier (low storage costs, high request costs),
59
+
it's possible that the request costs can dominate the overall backup costs.
60
+
``event-based-hold`` mode aims to reduce costs in such scenarios.
61
+
62
+
Note that since the holds for previous snapshot are released only during the backup task execution,
63
+
corresponding files won't be removed from the backup storage for at least ``bucket_retention_period + backup_task_interval``.
64
+
65
+
Note that because all objects uploaded to the bucket are subject to the default retention policy,
66
+
files coming from aborted backups, temporary manifests and permission check files can't be removed
67
+
until their holds are released and the retention period expires.
68
+
30
69
Modes
31
70
=====
32
71
33
-
Retention lock supports three modes controlled by the :ref:`sctool backup --retention-lock-mode <sctool-backup>` flag:
72
+
Retention lock supports the following modes controlled by the :ref:`sctool backup --retention-lock-mode <sctool-backup>` flag:
34
73
35
74
* ``disabled`` (default): No retention lock is applied to snapshot files.
36
75
* ``unlocked``: Retention lock is applied but can be shortened or removed with special permissions (see `Prerequisites`_).
37
76
* ``locked``: Retention lock is applied and cannot be overridden. Once set, the lock cannot be removed or shortened, even by the bucket owner.
77
+
* ``event-based-hold``: While referenced by the newest snapshot, files are protected by default event based holds. After that, they are protected by default retention period.
38
78
39
79
Override Lock
40
80
=============
@@ -56,19 +96,30 @@ Prerequisites
56
96
57
97
.. group-tab:: Google Cloud Storage
58
98
59
-
.. rubric:: Bucket configuration
99
+
.. rubric:: Bucket configuration for ``unlocked`` and ``locked`` modes
60
100
61
101
The GCS bucket used as the backup location must have **Object Retention** enabled.
62
102
Refer to the `Enable and use object retention configurations documentation <https://docs.cloud.google.com/storage/docs/using-object-lock>`_
63
103
for instructions on creating a bucket with Object Retention enabled.
64
104
105
+
.. rubric:: Bucket configuration for ``event-based-hold`` mode
106
+
107
+
The GCS bucket used as the backup location must have a **default retention policy** configured -
108
+
it defines the protection period of snapshot files (see `How It Works`_).
109
+
Refer to the `Use and lock retention policies <https://docs.cloud.google.com/storage/docs/using-bucket-lock#set-policy>`_
110
+
for instructions on setting a default retention policy on a bucket.
111
+
112
+
It is also recommended to enable the **default event based hold** option on the bucket,
113
+
so that the initial request setting the hold can be avoided.
114
+
Refer to the `Use object holds <https://docs.cloud.google.com/storage/docs/holding-objects#set-default-hold>`_ for details.
115
+
65
116
.. rubric:: Permissions
66
117
67
118
The GCS service account used by ScyllaDB Manager Agent must have the following permissions
68
119
on the backup bucket:
69
120
70
121
* ``storage.objects.update`` — required for updating object metadata.
71
-
* ``storage.objects.setRetention`` — required for applying retention locks to snapshot files.
122
+
* ``storage.objects.setRetention`` — required for applying retention locks to snapshot files in ``unlocked`` and ``locked`` modes.
72
123
* ``storage.objects.overrideUnlockedRetention`` — required when using the ``--override-retention-lock`` flag
73
124
to modify or remove existing locks in ``unlocked`` mode.
74
125
@@ -97,11 +148,18 @@ You can also :ref:`update an existing backup task <backup-update>` to enable ret
0 commit comments