-
Notifications
You must be signed in to change notification settings - Fork 9.2k
HDFS-16574. Reduces the time it takes once to hold FSNamesystem write lock to remove blocks associated with dead datanodes #4322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ove blocks associated with dead datanodes
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
| int numBlocksRemovedPerLock = 0; | ||
| while(it.hasNext()) { | ||
| if (numBlocksRemovedPerLock >= numBlocksPerRemove) { | ||
| namesystem.writeUnlock(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this code tested? It's usually not wise to release the namenode lock arbitrarily.
Looking at the code, the iterator is not thread-safe and there is no guarantee the iterator will be able to get to the next one after the lock is re-acquired.
| if (numBlocksRemovedPerLock >= numBlocksPerRemove) { | ||
| namesystem.writeUnlock(); | ||
| try { | ||
| LOG.debug("Yielded lock during removing blocks associated to the dead datanode"); //释放锁,并sleep 500ns(1 ns = 10-9 s) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use English for comments.
|
We're closing this stale PR because it has been open for 100 days with no activity. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable. |
JIRA: HDFS-16574
Reduces the time it takes once to hold FSNamesystem write lock to remove blocks associated with dead datanodes.