[
https://issues.apache.org/jira/browse/HDFS-9034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15064481#comment-15064481
]
Surendra Singh Lilhore commented on HDFS-9034:
----------------------------------------------
Thanks [~benoyantony] for review and comment.
bq. 1. In DatanodeStats.substract, we subtract the storage capacity only if it
is NOT FAILED. But suppose it was good when we added it, then not subtracting
will be a mistake.
I don't think so it will happen. Storage failure will not be decided by
namenode, it will reported by datanode in heartbeat.
If you see this code.
{code}
synchronized void updateHeartbeat(final DatanodeDescriptor node,
StorageReport[] reports, long cacheCapacity, long cacheUsed,
int xceiverCount, int failedVolumes,
VolumeFailureSummary volumeFailureSummary) {
stats.subtract(node);
node.updateHeartbeat(reports, cacheCapacity, cacheUsed,
xceiverCount, failedVolumes, volumeFailureSummary);
stats.add(node);
}
{code}
Before updating the new state of Storage in {{node}}, it will subtract all old
storage which is in still good state. After this based on report it will update
the storage state in {{node}} then again it will add the storage based on new
state.
So after adding storage and before subtracting no chance of state change in
storage.
> "StorageTypeStats" Metric should not count failed storage.
> ----------------------------------------------------------
>
> Key: HDFS-9034
> URL: https://issues.apache.org/jira/browse/HDFS-9034
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: namenode
> Reporter: Archana T
> Assignee: Surendra Singh Lilhore
> Attachments: HDFS-9034.01.patch, HDFS-9034.02.patch,
> HDFS-9034.03.patch, HDFS-9034.04.patch, dfsStorage_NN_UI2.png
>
>
> When we remove one storage type from all the DNs, still NN UI shows entry of
> those storage type --
> Ex:for ARCHIVE
> Steps--
> 1. ARCHIVE Storage type was added for all DNs
> 2. Stop DNs
> 3. Removed ARCHIVE Storages from all DNs
> 4. Restarted DNs
> NN UI shows below --
> DFS Storage Types
> Storage Type Configured Capacity Capacity Used Capacity Remaining
> ARCHIVE 57.18 GB 64 KB (0%) 39.82 GB (69.64%) 64 KB
> 1
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)