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 e22d91d8aaf..51b804ccb28 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 @@ -3085,6 +3085,10 @@ boolean delete(String src, boolean recursive, boolean logRetryCache) removeBlocks(toRemovedBlocks); // Incremental deletion of blocks } logAuditEvent(true, operationName, src); + String syncStr = System.getenv("SYNC_COMMAND_LOGGING"); + if (syncStr != null && Boolean.parseBoolean(syncStr) == true) { + INodeKeyedObjects.syncUpdateDB(); + } return ret; }