You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by vj...@apache.org on 2021/11/24 06:44:32 UTC

[hbase] branch master updated: HBASE-26458 Update Snapshot TTL doc (#3852)

This is an automated email from the ASF dual-hosted git repository.

vjasani pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/master by this push:
     new e702aae  HBASE-26458 Update Snapshot TTL doc (#3852)
e702aae is described below

commit e702aaee6d6d336f529ba800e30c80430044dbbb
Author: Joel Swiatek <jo...@gmail.com>
AuthorDate: Tue Nov 23 22:44:01 2021 -0800

    HBASE-26458 Update Snapshot TTL doc (#3852)
    
    Signed-off-by: Duo Zhang <zh...@apache.org>
    Signed-off-by: Viraj Jasani <vj...@apache.org>
---
 src/main/asciidoc/_chapters/ops_mgt.adoc | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/src/main/asciidoc/_chapters/ops_mgt.adoc b/src/main/asciidoc/_chapters/ops_mgt.adoc
index dbdb752..cc3793a 100644
--- a/src/main/asciidoc/_chapters/ops_mgt.adoc
+++ b/src/main/asciidoc/_chapters/ops_mgt.adoc
@@ -3150,23 +3150,31 @@ TTL some notion of optional TTL (and optional default TTL) for snapshots could b
 hbase> snapshot 'mytable', 'snapshot1234', {TTL => 86400}
 ----
 
-The above command creates snapshot `snapshot1234` with TTL of 86400 sec(24 hours)
+The above command creates snapshot `snapshot1234` with TTL of 86400 sec (24 hours)
 and hence, the snapshot is supposed to be cleaned up after 24 hours
 
 
 
 .Default Snapshot TTL:
+- User specified default TTL with config `hbase.master.snapshot.ttl`
+- FOREVER if `hbase.master.snapshot.ttl` is not set
 
-- FOREVER by default
-- User specified Default TTL with config `hbase.master.snapshot.ttl`
+While creating a snapshot, if TTL in seconds is not explicitly specified, the above logic will be
+followed to determine the TTL. If no configs are changed, the default behavior is that all snapshots
+will be retained forever (until manual deletion). If a different default TTL behavior is desired,
+`hbase.master.snapshot.ttl` can be set to a default TTL in seconds. Any snapshot created without
+an explicit TTL will take this new value.
 
+NOTE: If `hbase.master.snapshot.ttl` is set, a snapshot with an explicit {TTL => 0} or
+{TTL => -1} will also take this value. In this case, a TTL < -1 (such as {TTL => -2} should be used
+to indicate FOREVER.
 
-While creating a Snapshot, if TTL in seconds is not specified, by default the snapshot
-would not be deleted automatically. i.e. it would be retained forever until it is
-manually deleted. However, the user can update this default TTL behavior by
-providing default TTL in sec for key: `hbase.master.snapshot.ttl`.
-Value 0 for this config indicates TTL: FOREVER
+To summarize concisely,
 
+1. Snapshot with TTL value < -1 will stay forever regardless of any server side config changes (until deleted manually by user).
+2. Snapshot with TTL value > 0 will be deleted automatically soon after TTL expires.
+3. Snapshot created without specifying TTL will always have TTL value represented by config `hbase.master.snapshot.ttl`. Default value of this config is 0, which represents: keep the snapshot forever (until deleted manually by user).
+4. From client side, TTL value 0 or -1 should never be explicitly provided because they will be treated same as snapshot without TTL (same as above point 3) and hence will use TTL as per value represented by config `hbase.master.snapshot.ttl`.
 
 .Take a snapshot with custom MAX_FILESIZE