[
https://issues.apache.org/jira/browse/HDFS-14798?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16920924#comment-16920924
]
Ayush Saxena commented on HDFS-14798:
-------------------------------------
Ideally I believe we should refrain from any changes, for which we don't have
any fixed reason for doing. To make a change either it should be a bug, not
could be a bug, which we should properly cover with a test, or an improvement.
which this doesn't tend to be one.
Adding synchronization may look like a preventive measure and low cost but may
have its own repercussions, "premature optimization is the root of all evils"
as it is claimed. So better we hold it up for sometime. And I would try writing
a UT to check if it can cause a trouble or not, That is what max I can assure.
:)
> Synchronize invalidateBlocks in DatanodeDescriptor
> --------------------------------------------------
>
> Key: HDFS-14798
> URL: https://issues.apache.org/jira/browse/HDFS-14798
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: namenode
> Affects Versions: 3.2.0
> Reporter: David Mollitor
> Assignee: hemanthboyina
> Priority: Minor
> Labels: n00b, newbie
> Attachments: HDFS-14798.001.patch
>
>
> {code:java|title=DatanodeDescriptor.java}
> public void resetBlocks() {
> ...
> this.invalidateBlocks.clear();
> ...
> }
> public void clearBlockQueues() {
> synchronized (invalidateBlocks) {
> this.invalidateBlocks.clear();
> }
> ...
> }
> {code}
> It may not be strictly necessary, but why risk it? The invalidateBlocks
> should be protected in {{resetBlocks()}} just like it is in
> {{clearBlockQueues()}}/
--
This message was sent by Atlassian Jira
(v8.3.2#803003)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]