private void handleVolumeFailures(Set<FsVolumeSpi> unhealthyVolumes) { if (unhealthyVolumes.isEmpty()) { LOG.debug("handleVolumeFailures done with empty " + "unhealthyVolumes"); return; } data.handleVolumeFailures(unhealthyVolumes); Set<StorageLocation> unhealthyLocations = new HashSet<>( unhealthyVolumes.size()); StringBuilder sb = new StringBuilder("DataNode failed volumes:"); for (FsVolumeSpi vol : unhealthyVolumes) { unhealthyLocations.add(vol.getStorageLocation()); sb.append(vol.getStorageLocation()).append(";"); } try { // Remove all unhealthy volumes from DataNode. removeVolumes(unhealthyLocations, false); } catch (IOException e) { LOG.warn("Error occurred when removing unhealthy storage dirs", e); } LOG.debug("{}", sb); // send blockreport regarding volume failure handleDiskError(sb.toString()); }
/** * Check the disk error */ private void checkDiskError() { Set<File> unhealthyDataDirs = data.checkDataDir(); if (unhealthyDataDirs != null && !unhealthyDataDirs.isEmpty()) { try { // Remove all unhealthy volumes from DataNode. removeVolumes(unhealthyDataDirs, false); } catch (IOException e) { LOG.warn("Error occurred when removing unhealthy storage dirs: " + e.getMessage(), e); } StringBuilder sb = new StringBuilder("DataNode failed volumes:"); for (File dataDir : unhealthyDataDirs) { sb.append(dataDir.getAbsolutePath() + ";"); } handleDiskError(sb.toString()); } }
/** * Check if there is a disk failure and if so, handle the error * **/ protected void checkDiskError( ) { try { data.checkDataDir(); } catch(DiskErrorException de) { handleDiskError(de.getMessage()); } }
/** * Check the disk error */ private void checkDiskError() { Set<File> unhealthyDataDirs = data.checkDataDir(); if (unhealthyDataDirs != null && !unhealthyDataDirs.isEmpty()) { try { // Remove all unhealthy volumes from DataNode. removeVolumes(unhealthyDataDirs, false); } catch (IOException e) { LOG.warn("Error occurred when removing unhealthy storage dirs: " + e.getMessage(), e); } StringBuilder sb = new StringBuilder("DataNode failed volumes:"); for (File dataDir : unhealthyDataDirs) { sb.append(dataDir.getAbsolutePath() + ";"); } handleDiskError(sb.toString()); } }
protected void checkDiskError( ) throws IOException { try { data.checkDataDir(); } catch(DiskErrorException de) { handleDiskError(de.getMessage()); } }
timeLastCheckDisk = System.currentTimeMillis(); } catch(DiskErrorException de) { handleDiskError(de.getMessage()); } finally { checkingDisk.set(false);