[ 
https://issues.apache.org/jira/browse/HDFS-8674?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14603873#comment-14603873
 ] 

Ming Ma commented on HDFS-8674:
-------------------------------

Thanks [~daryn]!

* The motivation of randomization is to make sure we don't end up scanning the 
same blocks if there isn't much update to postponedMisreplicatedBlocks. But 
maybe that doesn't matter much as it will eventually be drained; also HashSet 
doesn't make order guarantee.
* Does the latency of couple seconds come from HashSet iteration? Some quick 
test indicates iterating through 5M entries of a HashSet take around 50ms.
* What is the reason to change from HashSet to LinkedHashSet, to have some 
order guarantee? HashSet is faster than LinkedHashSet.
* During the scan, if a block is marked as POSTPONE, it will be removed from 
postponedMisreplicatedBlocks first and add it back later via 
rescannedMisreplicatedBlocks. Can it just remove those blocks from 
postponedMisreplicatedBlocks that aren't marked as POSTPONE without using 
rescannedMisreplicatedBlocks?

> Improve performance of postponed block scans
> --------------------------------------------
>
>                 Key: HDFS-8674
>                 URL: https://issues.apache.org/jira/browse/HDFS-8674
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: HDFS
>    Affects Versions: 2.6.0
>            Reporter: Daryn Sharp
>            Assignee: Daryn Sharp
>            Priority: Critical
>         Attachments: HDFS-8674.patch
>
>
> When a standby goes active, it marks all nodes as "stale" which will cause 
> block invalidations for over-replicated blocks to be queued until full block 
> reports are received from the nodes with the block.  The replication monitor 
> scans the queue with O(N) runtime.  It picks a random offset and iterates 
> through the set to randomize blocks scanned.
> The result is devastating when a cluster loses multiple nodes during a 
> rolling upgrade. Re-replication occurs, the nodes come back, the excess block 
> invalidations are postponed. Rescanning just 2k blocks out of millions of 
> postponed blocks may take multiple seconds. During the scan, the write lock 
> is held which stalls all other processing.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to