Skip to content

Commit 57f7370

Browse files
committed
Revert "HDFS-14476. lock too long when fix inconsistent blocks between disk and in-memory. Contributed by Sean Chow."
This reverts commit b58a35f.
1 parent 3ad1fcf commit 57f7370

File tree

1 file changed

+1
-14
lines changed
  • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode

1 file changed

+1
-14
lines changed

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DirectoryScanner.java

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public class DirectoryScanner implements Runnable {
6666
LoggerFactory.getLogger(DirectoryScanner.class);
6767

6868
private static final int DEFAULT_MAP_SIZE = 32768;
69-
private static final int RECONCILE_BLOCKS_BATCH_SIZE = 1000;
69+
7070
private final FsDatasetSpi<?> dataset;
7171
private final ExecutorService reportCompileThreadPool;
7272
private final ScheduledExecutorService masterThread;
@@ -424,23 +424,10 @@ void shutdown() {
424424
*/
425425
@VisibleForTesting
426426
public void reconcile() throws IOException {
427-
LOG.debug("reconcile start DirectoryScanning");
428427
scan();
429428

430-
// HDFS-14476: run checkAndUpadte with batch to avoid holding the lock too
431-
// long
432-
int loopCount = 0;
433429
for (final Map.Entry<String, ScanInfo> entry : diffs.getEntries()) {
434430
dataset.checkAndUpdate(entry.getKey(), entry.getValue());
435-
436-
if (loopCount % RECONCILE_BLOCKS_BATCH_SIZE == 0) {
437-
try {
438-
Thread.sleep(2000);
439-
} catch (InterruptedException e) {
440-
// do nothing
441-
}
442-
}
443-
loopCount++;
444431
}
445432

446433
if (!retainDiffs) {

0 commit comments

Comments
 (0)