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



##########
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:
       `CorruptedSnapshotException` contains a copy of `SnapshotDescription`. 
Where this is logged, instead of logging the exception, it can grab the snaps 
tho info out of the description field to build a more meaningful log message.
   
   I don't know about the log level. I guess it depends on if you think this is 
a really severe problem or not. If not, `debug` is fine. If it's the only sign 
an operator has of a bad problem, or it should be `info` or `warn`.




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