dParikesit commented on code in PR #6970:
URL: https://github.com/apache/hbase/pull/6970#discussion_r2098968614


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/SnapshotProcedure.java:
##########
@@ -184,6 +186,12 @@ protected Flow executeFromState(MasterProcedureEnv env, 
SnapshotState state)
           if (isSnapshotCorrupted()) {
             throw new CorruptedSnapshotException(snapshot.getName());
           }
+          if (
+            SnapshotDescriptionUtils.isExpiredSnapshot(snapshot.getTtl(),
+              snapshot.getCreationTime(), EnvironmentEdgeManager.currentTime())
+          ) {
+            throw new 
SnapshotTTLExpiredException(ProtobufUtil.createSnapshotDesc(snapshot));
+          }

Review Comment:
   Thank you for the review!
   
   I agree that it might be fine because we perform checks during the restore 
process. I just thought that redundant check would make it more consistent. 
Let's hear what @Apache9 thinks of it.
   
   > If we go with your approach, i think we should also add the same 
validation logic in SnapshotManager.java, since HBase also supports creating 
snapshots without using snapshot procedure, right?
   
   Oh that's right, I missed that one. Thanks for noticing it, I'll put the 
check if we agree that preemptive checking is needed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to