ThinkerLei commented on code in PR #6809:
URL: https://github.com/apache/hadoop/pull/6809#discussion_r1600246934
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/LeaseManager.java:
##########
@@ -626,7 +626,8 @@ private synchronized boolean checkLeases(Collection<Lease>
leasesToCheck) {
}
}
// If a lease recovery happened, we need to sync later.
Review Comment:
@Hexiaoqiao @vinayakumarb Thank you very much for your comment. In the one
hand, we may indeed not need to invoke logSync() in time. The purpose of this
modification is to ensure that `editlog` can be `sync` in a timely manner like
other write operations,so as to prevent the loss of the `editlog` in some
extreme cases. on the other hand, @vinayakumarb I'm still a little confused by
what you're saying. The current modification
```
boolean isClosed = !lastINode.isUnderConstruction();
if (!needSync && (!completed || isClosed)) {
needSync = true;
}
```
has ensured that leaseMonitor can invoke `logSync()` when the file gets
closed and `reassign lease`. File gets closed, `isClosed` will be true. Lease
reassigned , `completed` will be false and the initial value of `needSync` is
false.
--
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]