Uploaded image for project: 'Apache Ozone'
  1. Apache Ozone
  2. HDDS-8914

Datanode may fail to start due to duplicate VolumeInfoMetrics

    XMLWordPrintableJSON

Details

    Description

            try {
              StorageLocation location = StorageLocation.parse(locationString);
      
      
              StorageVolume volume = volumeFactory.createVolume(
                  location.getUri().getPath(), location.getStorageType());
      
      
              LOG.info("Added Volume : {} to VolumeSet",
                  volume.getStorageDir().getPath());
      
      
              if (!volume.getStorageDir().mkdirs() &&
                  !volume.getStorageDir().exists()) {
                throw new IOException("Failed to create storage dir " +
                    volume.getStorageDir());
              }
              volumeMap.put(volume.getStorageDir().getPath(), volume);
              volumeStateMap.get(volume.getStorageType()).add(volume);
            } catch (IOException e) {
              StorageVolume volume =
                  volumeFactory.createFailedVolume(locationString);
              failedVolumeMap.put(locationString, volume);
              LOG.error("Failed to parse the storage location: " + locationString, e);
            }
      

      Any IOException thrown from/after volumeFactory.createVolume results in the creation of another, failed volume for the same dir (volumeFactory.createFailedVolume).

      Metrics is registered for each HddsVolume in its constructor. The metrics for the original volume should be unregistered, otherwise we get:

      MetricsException: Metrics source VolumeInfoMetrics-/data/hdds/... already exists
      

      and datanode fails to start.

      Attachments

        Issue Links

          Activity

            People

              adoroszlai Attila Doroszlai
              adoroszlai Attila Doroszlai
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: