[ 
https://issues.apache.org/jira/browse/HDFS-17117?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17746179#comment-17746179
 ] 

ASF GitHub Bot commented on HDFS-17117:
---------------------------------------

Hexiaoqiao commented on code in PR #5877:
URL: https://github.com/apache/hadoop/pull/5877#discussion_r1271707754


##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java:
##########
@@ -3891,6 +3891,8 @@ private void processMisReplicatesAsync() throws 
InterruptedException {
         // initialisation, then progress might be different.
         reconstructionQueuesInitProgress = Math.min((double) totalProcessed
             / totalBlocks, 1.0);
+        LOG.info("Reconstruction queues initialisation progress: {}, total 
number of blocks " +

Review Comment:
   I have always believed that it is not a good practice to involve some 
IOs(include print log) inner Read/Write Lock, here in global write lock. Please 
check if it could move out.



##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/metrics/FSNamesystemMBean.java:
##########
@@ -261,4 +261,11 @@ public interface FSNamesystemMBean {
    * @return The number of paths to be processed by sps.
    */
   int getPendingSPSPaths();
+
+  /**
+   * Get the progress of the reconstruction queues initialisation
+   *
+   * @return Returns values between 0 and 1 for the progress.
+   */
+  double getReconstructionQueuesInitProgress();

Review Comment:
   Add unit test should be better.





> BlockManager#processMisReplicatesAsync can periodically print 
> reconstructionQueuesInitProgress
> ----------------------------------------------------------------------------------------------
>
>                 Key: HDFS-17117
>                 URL: https://issues.apache.org/jira/browse/HDFS-17117
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: Haiyang Hu
>            Assignee: Haiyang Hu
>            Priority: Major
>              Labels: pull-request-available
>
> BlockManager#processMisReplicatesAsync can periodically print 
> reconstructionQueuesInitProgress,  so that the admin can get the progress of 
> the replication queues initialisation.
> Ready to add logs and metrics.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to