The fields in DatanodeStorageInfo are updated from two distinct paths:
- block reports
- storage reports (via heartbeats)
The state and storageType fields are updated via the Block Report. However, as seen in the code blow, these fields are populated from a "dummy" DatanodeStorage object constructed in the DataNode:
The net effect is that the state and storageType fields are always the default of NORMAL and DISK in the NameNode.
The recommended fix is to change FsDatasetSpi.getBlockReports() from:
thereby allowing BPServiceActor to send the "real" DatanodeStorage object with the block report.