brfrn169 commented on a change in pull request #2052:
URL: https://github.com/apache/hadoop/pull/2052#discussion_r435223943



##########
File path: 
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java
##########
@@ -578,7 +578,13 @@ public void removeVolumes(
           // Unlike updating the volumeMap in addVolume(), this operation does
           // not scan disks.
           for (String bpid : volumeMap.getBlockPoolList()) {
-            List<ReplicaInfo> blocks = new ArrayList<>();
+            List<ReplicaInfo> blocks;
+            if (blkToInvalidate.containsKey(bpid)) {
+              blocks = blkToInvalidate.get(bpid);
+            } else {
+              blocks = new ArrayList<>();
+              blkToInvalidate.put(bpid, blocks);
+            }

Review comment:
       @sodonnel Thank you for reviewing this!
   
   Okay, I will change the code for your review here. And after this is 
committed to trunk, I will make a new PR for branch 2, which is like the 
original code. 




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to