Skip to content

Commit 2ff2a7f

Browse files
HDFS-14798. Synchronize invalidateBlocks in DatanodeDescriptor. Contributed by hemanthboyina.
1 parent d1c303a commit 2ff2a7f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/DatanodeDescriptor.java

100644100755
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,9 @@ boolean hasStaleStorages() {
339339

340340
public void resetBlocks() {
341341
updateStorageStats(this.getStorageReports(), 0L, 0L, 0, 0, null);
342-
this.invalidateBlocks.clear();
342+
synchronized (invalidateBlocks) {
343+
this.invalidateBlocks.clear();
344+
}
343345
this.volumeFailures = 0;
344346
// pendingCached, cached, and pendingUncached are protected by the
345347
// FSN lock.

0 commit comments

Comments
 (0)