I'm observing inconsistencies in the DataStorage.namespaceID value passed in to my FsDatasetSpi plugin:
- Upon initial startup (when the DataNode is formatted), the storage DataStorage.namespaceID value is populated with the namespace ID from the NameNode (or an arbitrary namenode in a federated setup).
- Upon subsequent startups the DataStorage.namespaceID value is NULL.
The issue appears to be different handling of the DataStorage.namespaceID value in DataStorage.format() vs. DataStorage.setFieldsFromProperties():
If I understand correctly, the proper fix is to leave namespaceID unset in DataStorage.format(). The namespaceID here is invalid anyway since it is susceptible to race conditions in federated NameNode setups – it will happen to match the namespaceID of the first BPOfferService thread that successfully handshakes.