If the IP address or hostname of a data node changes

The namenode updates the mapping between file name and block name
The data in that data node is lost forever
The namenode need not update mapping between file name and block name
There namenode has to be restarted

The correct answer is: A. The namenode updates the mapping between file name and block name.

When the IP address or hostname of a data node changes, the namenode needs to update the mapping between file name and block name. This is because the namenode stores the location of each block of data on each data node. When the IP address or hostname of a data node changes, the namenode needs to update this information so that it can still access the data on that data node.

If the namenode does not update the mapping, then it will not be able to access the data on the data node with the changed IP address or hostname. This can cause problems if the data on that data node is needed.

The other options are incorrect because:

  • Option B is incorrect because the data in that data node is not lost forever. The data is still stored on the data node, but the namenode cannot access it until it updates the mapping.
  • Option C is incorrect because the namenode does need to update the mapping between file name and block name.
  • Option D is incorrect because the namenode does not need to be restarted.