[
https://issues.apache.org/jira/browse/CASSANDRA-16790?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17530277#comment-17530277
]
Paulo Motta edited comment on CASSANDRA-16790 at 4/30/22 12:40 AM:
-------------------------------------------------------------------
I rebased the original patch by [~fibersel] that was blocked by CASSANDRA-16843
and added tests to make the following assertions:
a) Snapshots created by the auto_snapshot option should only have TTL if and
only if the auto_snapshot_ttl option is supplied.
b) Snapshots created via the auto_snapshot_ttl should expire after the TTL is
elapsed.
This patch is very simple, it basically:
* Adds a new option to cassandra.yaml: "auto_snapshot_ttl", disabled by
default
([code|https://github.com/apache/cassandra/pull/1596/files#diff-054af65b8d690b0fddc3e0a4ef05a80d8f1d6689b4f77912795fec019200666cR398]).
* When creating a snapshot during drop or truncate, use the supplied
auto_snapshot_ttl to create the snapshot.
**
[drop|https://github.com/apache/cassandra/pull/1596/files#diff-9db147d2e310e83ba17e4b4c756ce0aa90ce1742006fa3bc2418aaaf1fe4b7c9R3197]
**
[truncate|https://github.com/apache/cassandra/pull/1596/files#diff-9db147d2e310e83ba17e4b4c756ce0aa90ce1742006fa3bc2418aaaf1fe4b7c9R2635]
The snapshot TTL cleanup mechanics was added by CASSANDRA-16789, the only thing
this patch does is to add the ability of setting a default ttl to
auto-snapshots (those created by drop or truncate when auto_snapshot: true is
enabled).
I didn't find any unit or in-jvm tests for the auto_snapshot functionality, so
this patch will significantly increase the test coverage for this code path.
The added tests are available in these two classes:
*
[AutoSnapshotTtlTest|https://github.com/apache/cassandra/blob/2c0cdd5d1077c58913f5841441ff99249d873b3e/test/distributed/org/apache/cassandra/distributed/test/AutoSnapshotTtlTest.java]
(in-jvm dtests)
*
[AutoSnapshotTest|https://github.com/apache/cassandra/blob/975580f0fd87175d94f5efaed330c242dcee035f/test/unit/org/apache/cassandra/cql3/validation/operations/AutoSnapshotTest.java]
(unit tests)
PR and CI is available below:
|[PR|https://github.com/apache/cassandra/pull/1596]|[CI|https://ci-cassandra.apache.org/view/patches/job/Cassandra-devbranch/1651/]|
was (Author: paulo):
I rebased the original patch by [~fibersel] that was blocked by CASSANDRA-16843
and added tests to make the following assertions:
a) Snapshots created by the auto_snapshot option should only have TTL if and
only if the auto_snapshot_ttl option is supplied.
b) Snapshots created via the auto_snapshot_ttl should expire after the TTL is
elapsed.
This patch is very simple, it basically:
* Adds a new option to cassandra.yaml: "auto_snapshot_ttl", disabled by
default
([code|https://github.com/apache/cassandra/pull/1596/files#diff-054af65b8d690b0fddc3e0a4ef05a80d8f1d6689b4f77912795fec019200666cR398]).
* When creating a snapshot during drop or truncate, use the supplied
auto_snapshot_ttl to create the snapshot.
**
[drop|https://github.com/apache/cassandra/pull/1596/files#diff-9db147d2e310e83ba17e4b4c756ce0aa90ce1742006fa3bc2418aaaf1fe4b7c9R3197]
**
[truncate|https://github.com/apache/cassandra/pull/1596/files#diff-9db147d2e310e83ba17e4b4c756ce0aa90ce1742006fa3bc2418aaaf1fe4b7c9R2635]
The snapshot TTL cleanup mechanics was added by CASSANDRA-16789, the only thing
this patch does is to add the ability of setting a default ttl to
auto-snapshots (those created by drop or truncate when auto_snapshot: true is
enabled).
I didn't find any unit or in-jvm tests for the auto_snapshot functionality, so
this patch will significantly increase the test coverage for this code path.
The added tests are available in these two classes:
*
[AutoSnapshotTtlTest|https://github.com/apache/cassandra/blob/975580f0fd87175d94f5efaed330c242dcee035f/test/distributed/org/apache/cassandra/distributed/test/AutoSnapshotTtlTest.java]
(in-jvm dtests)
*
[AutoSnapshotTest|https://github.com/apache/cassandra/blob/975580f0fd87175d94f5efaed330c242dcee035f/test/unit/org/apache/cassandra/cql3/validation/operations/AutoSnapshotTest.java]
(unit tests)
PR and CI is available below:
|[PR|https://github.com/apache/cassandra/pull/1596]|[CI|https://ci-cassandra.apache.org/view/patches/job/Cassandra-devbranch/1651/]|
> Add auto_snapshot_ttl configuration
> -----------------------------------
>
> Key: CASSANDRA-16790
> URL: https://issues.apache.org/jira/browse/CASSANDRA-16790
> Project: Cassandra
> Issue Type: Sub-task
> Components: Local/Config, Local/Snapshots
> Reporter: Paulo Motta
> Assignee: Stefan Miklosovic
> Priority: Normal
> Fix For: 4.1
>
>
> This property should take a human readable parameter (ie. 6h, 3days). When
> specified and {{auto_snapshot: true}}, auto snapshots created should use the
> specified TTL.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]