supratimdeka commented on a change in pull request #628: HDDS-1008. Invalidate
closed container replicas on a failed volume.
URL: https://github.com/apache/hadoop-ozone/pull/628#discussion_r387657656
##########
File path:
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/VolumeSet.java
##########
@@ -239,23 +249,24 @@ private void checkAllVolumes() throws IOException {
* @param failedVolumes
*/
private void handleVolumeFailures(Set<HddsVolume> failedVolumes) {
- for (HddsVolume v: failedVolumes) {
- this.writeLock();
- try {
+ this.writeLock();
+ try {
+ for (HddsVolume v : failedVolumes) {
// Immediately mark the volume as failed so it is unavailable
// for new containers.
- volumeMap.remove(v.getHddsRootDir().getPath());
- failedVolumeMap.putIfAbsent(v.getHddsRootDir().getPath(), v);
- } finally {
- this.writeUnlock();
+ failVolume(v.getHddsRootDir().getPath());
}
-
- // TODO:
- // 1. Mark all closed containers on the volume as unhealthy.
- // 2. Consider stopping IO on open containers and tearing down
- // active pipelines.
- // 3. Handle Ratis log disk failure.
+ if (failedVolumeListener != null) {
Review comment:
This can probably be done outside the writeLock - should be safe.
also, we can invoke the listener outside the for loop - perhaps like:
if (!failedVolumes.isEmpty()) {failedVolumeListener.run();}
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]