[ https://issues.apache.org/jira/browse/HDFS-11291?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15800087#comment-15800087 ]
Yiqun Lin commented on HDFS-11291: ---------------------------------- Thanks [~surendrasingh] for the work on this. Yes, it will avoid extra rpc calls. And I looked into your patch, it almost looks good to me. Only one place I noticed: In the patch, you use the method {{INodeFile#getFileReplication}} to get the old replication, {code} + if (inode.asFile().getFileReplication() == replication) { + return true; + } {code} However, the original code uses the method {{INodeFile#getPreferredBlockReplication}} (get the max replication value between file blocks and file) {code} short oldBR = file.getPreferredBlockReplication(); {code} Should we keep this consistent? In addition, can you test failure test {{hadoop.hdfs.tools.offlineEditsViewer.TestOfflineEditsViewer}} in your local, it seems related. Others look good to me. Thanks. > Avoid unnecessary edit log for setStoragePolicy() and setReplication() > ---------------------------------------------------------------------- > > Key: HDFS-11291 > URL: https://issues.apache.org/jira/browse/HDFS-11291 > Project: Hadoop HDFS > Issue Type: Bug > Reporter: Surendra Singh Lilhore > Assignee: Surendra Singh Lilhore > Attachments: HDFS-11291.001.patch > > > We are setting the storage policy for file without checking the current > policy of file for avoiding extra getStoragePolicy() rpc call. Currently > namenode is not checking the current storage policy before setting new one > and adding edit logs. I think if the old and new storage policy is same we > can avoid set operation. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org