diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java index 5742918ec43..0fb43b3a486 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java @@ -3712,7 +3712,10 @@ public class HBaseAdmin implements Admin { builder.setTable(tableName.getNameAsString()); builder.setName(snapshotName); builder.setType(type); - builder.setTtl(getTtlFromSnapshotProps(snapshotProps)); + long ttl = getTtlFromSnapshotProps(snapshotProps); + if (ttl != -1L && ttl < TimeUnit.MILLISECONDS.toSeconds(Long.MAX_VALUE)) { + builder.setTtl(ttl); + } snapshot(builder.build()); } diff --git a/src/main/asciidoc/_chapters/ops_mgt.adoc b/src/main/asciidoc/_chapters/ops_mgt.adoc index 6f60a42a789..f2a25ca5f28 100644 --- a/src/main/asciidoc/_chapters/ops_mgt.adoc +++ b/src/main/asciidoc/_chapters/ops_mgt.adoc @@ -2224,7 +2224,6 @@ Value 0 for this config indicates TTL: FOREVER - .Enable/Disable Snapshot Auto Cleanup on running cluster: By default, snapshot auto cleanup based on TTL would be enabled