diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 56f8ec361e..1cc31b2558 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -472,6 +472,9 @@ Release 2.8.0 - UNRELEASED HDFS-8052. Move WebHdfsFileSystem into hadoop-hdfs-client. (wheat9) + HDFS-8176. Record from/to snapshots in audit log for snapshot diff report. + (J. Andreina via jing9) + OPTIMIZATIONS HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java index 4477dc4623..229c4d1350 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java @@ -7406,8 +7406,12 @@ SnapshotDiffReport getSnapshotDiffReport(String path, } finally { readUnlock(); } - - logAuditEvent(diffs != null, "computeSnapshotDiff", null, null, null); + String fromSnapshotRoot = (fromSnapshot == null || fromSnapshot.isEmpty()) ? + path : Snapshot.getSnapshotPath(path, fromSnapshot); + String toSnapshotRoot = (toSnapshot == null || toSnapshot.isEmpty()) ? + path : Snapshot.getSnapshotPath(path, toSnapshot); + logAuditEvent(diffs != null, "computeSnapshotDiff", fromSnapshotRoot, + toSnapshotRoot, null); return diffs; }