You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2022/01/18 01:41:28 UTC

[GitHub] [hadoop] tasanuma commented on a change in pull request #3887: HDFS-16426. Fix nextBlockReportTime when trigger full block report force

tasanuma commented on a change in pull request #3887:
URL: https://github.com/apache/hadoop/pull/3887#discussion_r786361910



##########
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:
       @liubingxing @tomscut 
   Thanks for the discussion. IMHO, I prefer to use a random time to keep the randomness.
   I think HDFS-15167 causes this problem. Before HDFS-15167, `resetBlockReportTime` is true when triggering full block report by force, and it used a random time.




-- 
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-unsubscribe@hadoop.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org