[ 
https://issues.apache.org/jira/browse/HDFS-16426?focusedWorklogId=708986&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-708986
 ]

ASF GitHub Bot logged work on HDFS-16426:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 14/Jan/22 11:42
            Start Date: 14/Jan/22 11:42
    Worklog Time Spent: 10m 
      Work Description: tomscut commented on a change in pull request #3887:
URL: https://github.com/apache/hadoop/pull/3887#discussion_r784777863



##########
File path: 
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java
##########
@@ -1304,12 +1305,18 @@ long scheduleBlockReport(long delay, boolean 
isRegistration) {
      * Numerical overflow is possible here.
      */
     void scheduleNextBlockReport() {
+      scheduleNextBlockReport(false);
+    }
+
+    void scheduleNextBlockReport(boolean forceFullBr) {
       // If we have sent the first set of block reports, then wait a random
       // time before we start the periodic block reports.
       if (resetBlockReportTime) {
         nextBlockReportTime.getAndSet(monotonicNow() +
             ThreadLocalRandom.current().nextInt((int) 
(blockReportIntervalMs)));
         resetBlockReportTime = false;
+      } else if (forceFullBr) {
+        nextBlockReportTime.getAndSet(monotonicNow() + blockReportIntervalMs);

Review comment:
       > I think that in most of cases, we want to know the exactly 
nextBlockReportTime if we trigger block report by force. As for trigger full 
block report in batches, I think it is a dangerous behavior because it may 
cause some datanode heartbeat timeout.
   
   I mean, if we trigger the FBR on some nodes in a short period of time, it 
will affect the original randomness.




-- 
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: common-issues-unsubscr...@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 708986)
    Time Spent: 1h  (was: 50m)

> fix nextBlockReportTime when trigger full block report force
> ------------------------------------------------------------
>
>                 Key: HDFS-16426
>                 URL: https://issues.apache.org/jira/browse/HDFS-16426
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: liubingxing
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> When we trigger full block report force by command line, the next block 
> report time will be set like this:
> nextBlockReportTime.getAndAdd(blockReportIntervalMs);
> nextBlockReportTime will larger than blockReportIntervalMs.
> If we trigger full block report twice, the nextBlockReportTime will larger 
> than 2 * blockReportIntervalMs. This is obviously not what we want.
> We fix the nextBlockReportTime = now + blockReportIntervalMs after full block 
> report trigger by command line.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to