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:05:04 UTC
[hadoop] branch branch-2.8 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 branch-2.8
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/branch-2.8 by this push:
new e9021a6 Revert "HDFS-14476. lock too long when fix inconsistent blocks between disk and in-memory. Contributed by Sean Chow."
e9021a6 is described below
commit e9021a683352ceaccb6d538415092e2f0f05247d
Author: Wei-Chiu Chuang <we...@apache.org>
AuthorDate: Wed Aug 21 09:04:39 2019 -0700
Revert "HDFS-14476. lock too long when fix inconsistent blocks between disk and in-memory. Contributed by Sean Chow."
This reverts commit dbc7e4d74b3494e049bef6baf16efc88dca30fc3.
---
.../hadoop/hdfs/server/datanode/DirectoryScanner.java | 16 +---------------
1 file changed, 1 insertion(+), 15 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 6af528e..de57876 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
@@ -65,7 +65,6 @@ import org.apache.hadoop.util.Time;
public class DirectoryScanner implements Runnable {
private static final Log LOG = LogFactory.getLog(DirectoryScanner.class);
private static final int MILLIS_PER_SECOND = 1000;
- private static final int RECONCILE_BLOCKS_BATCH_SIZE = 1000;
private static final String START_MESSAGE =
"Periodic Directory Tree Verification scan"
+ " starting at %s with interval of %dms";
@@ -567,27 +566,14 @@ public class DirectoryScanner implements Runnable {
*/
@VisibleForTesting
void reconcile() throws IOException {
- LOG.debug("reconcile start DirectoryScanning");
scan();
for (Entry<String, LinkedList<ScanInfo>> entry : diffs.entrySet()) {
String bpid = entry.getKey();
LinkedList<ScanInfo> diff = entry.getValue();
-
- // HDFS-14476: run checkAndUpadte with batch to avoid holding the lock too
- // long
- int loopCount = 0;
+
for (ScanInfo info : diff) {
dataset.checkAndUpdate(bpid, info.getBlockId(), info.getBlockFile(),
info.getMetaFile(), info.getVolume());
-
- if (loopCount % RECONCILE_BLOCKS_BATCH_SIZE == 0) {
- try {
- Thread.sleep(2000);
- } catch (InterruptedException e) {
- // do nothing
- }
- }
- loopCount++;
}
}
if (!retainDiffs) clear();
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org