ndimiduk commented on a change in pull request #1791:
URL: https://github.com/apache/hbase/pull/1791#discussion_r431403678



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/SnapshotFileCache.java
##########
@@ -251,6 +260,25 @@ private void refreshCache() throws IOException {
     this.snapshots.putAll(newSnapshots);
   }
 
+  @VisibleForTesting
+  List<String> getSnapshotsInProgress() throws IOException {
+    List<String> snapshotInProgress = Lists.newArrayList();
+    // only add those files to the cache, but not to the known snapshots
+    FileStatus[] snapshotsInProgress = CommonFSUtils.listStatus(fs,
+      new Path(snapshotDir, SnapshotDescriptionUtils.SNAPSHOT_TMP_DIR_NAME));
+
+    if (!ArrayUtils.isEmpty(snapshotsInProgress)) {
+      for (FileStatus snapshot : snapshotsInProgress) {
+        try {
+          
snapshotInProgress.addAll(fileInspector.filesUnderSnapshot(snapshot.getPath()));
+        } catch (CorruptedSnapshotException cse) {
+          LOG.debug("Corrupted in-progress snapshot file exception, ignored.", 
cse);

Review comment:
       Could this be handled better? It seems that in the event of an 
exception, the entirety of the in-progress snapshot would excluded.
   
   Logging the exception doesn't tell us anything useful because the 
`SnapshotDescription` isn't party to the message. Maybe we should log the 
snapshot name and table name. At WARN level?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to