-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-26458 Add UNSET_SNAPSHOT_PROP and fix TTL defaulting #3857
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
@joswiatek I think here also we will have to follow the same approach as branch-2/master by converting -1 to 0 because proto already has 0 as default value of TTL that we don't want to change:
And the reason for converting to 0 from client side remains same as we discussed: server RPC payload itself has 0 as default (non-specified) value, hence server side should handle 0 as not specified TTL rather than -1. |
💔 -1 overall
This message was automatically generated. |
builder.setType(type); | ||
builder.setTtl(getTtlFromSnapshotProps(snapshotProps)); | ||
long ttl = getTtlFromSnapshotProps(snapshotProps); | ||
if (ttl != 1L && ttl < TimeUnit.MILLISECONDS.toSeconds(Long.MAX_VALUE)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be ttl != -1
?
💔 -1 overall
This message was automatically generated. |
https://issues.apache.org/jira/browse/HBASE-26458
Note that this change is possible in branch-1 because the TTL determined from the snapshotProps is always included in the protobuf in this code:
hbase/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
Lines 3708 to 3717 in 0d214ff
This is notably different from master and branch-2, where the TTL is only set if it is valid. If it is not set, then the default protobuf value of 0 is used, which matches
NO_SNAPSHOT_TTL_SPECIFIED
:hbase/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java
Lines 3089 to 3092 in b2571df