You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by we...@apache.org on 2019/08/21 16:01:29 UTC

[hadoop] branch trunk updated: Revert "HDFS-14476. lock too long when fix inconsistent blocks between disk and in-memory. Contributed by Sean Chow."

This is an automated email from the ASF dual-hosted git repository.

weichiu pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 57f7370  Revert "HDFS-14476. lock too long when fix inconsistent blocks between disk and in-memory. Contributed by Sean Chow."
57f7370 is described below

commit 57f737017465cccb0f6b5ab6e3130ef49a02d4c2
Author: Wei-Chiu Chuang <we...@apache.org>
AuthorDate: Wed Aug 21 08:59:49 2019 -0700

    Revert "HDFS-14476. lock too long when fix inconsistent blocks between disk and in-memory. Contributed by Sean Chow."
    
    This reverts commit b58a35f374a9a750fddc2fc92e7f7a7ae8a4d3a4.
---
 .../hadoop/hdfs/server/datanode/DirectoryScanner.java     | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DirectoryScanner.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DirectoryScanner.java
index aa5cdb8..445e021 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DirectoryScanner.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DirectoryScanner.java
@@ -66,7 +66,7 @@ public class DirectoryScanner implements Runnable {
       LoggerFactory.getLogger(DirectoryScanner.class);
 
   private static final int DEFAULT_MAP_SIZE = 32768;
-  private static final int RECONCILE_BLOCKS_BATCH_SIZE = 1000;
+
   private final FsDatasetSpi<?> dataset;
   private final ExecutorService reportCompileThreadPool;
   private final ScheduledExecutorService masterThread;
@@ -424,23 +424,10 @@ public class DirectoryScanner implements Runnable {
    */
   @VisibleForTesting
   public void reconcile() throws IOException {
-    LOG.debug("reconcile start DirectoryScanning");
     scan();
 
-    // HDFS-14476: run checkAndUpadte with batch to avoid holding the lock too
-    // long
-    int loopCount = 0;
     for (final Map.Entry<String, ScanInfo> entry : diffs.getEntries()) {
       dataset.checkAndUpdate(entry.getKey(), entry.getValue());
-
-      if (loopCount % RECONCILE_BLOCKS_BATCH_SIZE == 0) {
-        try {
-          Thread.sleep(2000);
-        } catch (InterruptedException e) {
-          // do nothing
-        }
-      }
-      loopCount++;
     }
 
     if (!retainDiffs) {


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