By removing the 'else' and no longer updating the state in the BlockReport processing path, we effectively get the bogus state & type that is set via the first heartbeat (see the fix for
Even reverting the change and reintroducing the 'else' leaves the state & type temporarily inaccurate until the first block report.
As discussed with arpitagarwal, a better fix would be to simply include the full DatanodeStorage object in the StorageReport (as opposed to only the Storage ID). This requires adding the DatanodeStorage object to StorageReportProto. It needs to be a new optional field and we cannot remove the existing StorageUuid for protocol compatibility.