ferhui commented on code in PR #6667:
URL: https://github.com/apache/hadoop/pull/6667#discussion_r1538715428


##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java:
##########
@@ -2004,13 +2004,14 @@ void metaSave(String filename) throws IOException {
         out.close();
       }
     } finally {
-      readUnlock(operationName, getLockReportInfoSupplier(null));
+      readUnlock(FSNamesystemLockMode.GLOBAL, operationName, 
getLockReportInfoSupplier(null));
     }
     logAuditEvent(true, operationName, null);
   }
 
   private void metaSave(PrintWriter out) {
-    assert hasReadLock();
+    assert hasReadLock(FSNamesystemLockMode.GLOBAL);
+    // Normally FSReadLock is needed here, but I think thread-safe is 
unnecessary here.

Review Comment:
   Can add TODO or remove opinions here?
   Or create another ticket to track it as an improvement?



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to