[ https://issues.apache.org/jira/browse/HDFS-17518?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17846350#comment-17846350 ]
ASF GitHub Bot commented on HDFS-17518: --------------------------------------- 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. > In the lease monitor, if a file is closed, we should sync the editslog > ---------------------------------------------------------------------- > > Key: HDFS-17518 > URL: https://issues.apache.org/jira/browse/HDFS-17518 > Project: Hadoop HDFS > Issue Type: Bug > Reporter: lei w > Assignee: lei w > Priority: Minor > Labels: pull-request-available > > In the lease monitor, if a file is closed, method checklease will return > true, and then the edits log will not be sync. In my opinion, we should sync > the edits log to avoid not synchronizing the state to the standby NameNode > for a long time. -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org