Ramesh N has posted comments on this change. Change subject: gluster: Disable Rebalance/Remove Brick when one or more bricks are down ......................................................................
Patch Set 2: (5 comments) .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/gluster/GlusterBrickValidator.java Line 52: Line 53: if (brickFromVolume == null) { Line 54: return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_BRICK_INVALID); Line 55: } else { Line 56: // Fill required details from volume data Done Line 57: brick.setServerName(brickFromVolume.getServerName()); Line 58: brick.setBrickDirectory(brickFromVolume.getBrickDirectory()); Line 59: } Line 60: Line 60: Line 61: } Line 62: Line 63: if (!forceRemove) { Line 64: return canRebalance(volumeEntity); If user removes one brick from each sub volume, it will reduce the replica count and it should be force remove without migration. So logically remove with migrate can be called only when user tries to remove a sub volume. And we have to make sure that at least one brick is up in each sub volume to support the data migration. Line 65: } else { Line 66: return ValidationResult.VALID; Line 67: } Line 68: } Line 60: Line 61: } Line 62: Line 63: if (!forceRemove) { Line 64: return canRebalance(volumeEntity); Done Line 65: } else { Line 66: return ValidationResult.VALID; Line 67: } Line 68: } Line 72: List<GlusterBrickEntity> bricks = volumeEntity.getBricks(); Line 73: if (volumeEntity.getVolumeType() == GlusterVolumeType.DISTRIBUTE) { Line 74: replicaCount = 1; Line 75: } else if (volumeEntity.getVolumeType() == GlusterVolumeType.DISTRIBUTED_REPLICATE) { Line 76: replicaCount = volumeEntity.getReplicaCount(); Done Line 77: } Line 78: Line 79: int i = 0, j = 0; Line 80: while (i < bricks.size()) { Line 75: } else if (volumeEntity.getVolumeType() == GlusterVolumeType.DISTRIBUTED_REPLICATE) { Line 76: replicaCount = volumeEntity.getReplicaCount(); Line 77: } Line 78: Line 79: int i = 0, j = 0; Done Line 80: while (i < bricks.size()) { Line 81: for (j = 0; j < replicaCount; j++) { Line 82: if (bricks.get(i + j).isOnline()) { Line 83: i = i + replicaCount; -- To view, visit http://gerrit.ovirt.org/19984 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib66fe531dfea6099a449fcae8c4370711ae3dd8b Gerrit-PatchSet: 2 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Ramesh N <rnach...@redhat.com> Gerrit-Reviewer: Kanagaraj M <kmayi...@redhat.com> Gerrit-Reviewer: Ramesh N <rnach...@redhat.com> Gerrit-Reviewer: Sahina Bose <sab...@redhat.com> Gerrit-Reviewer: Shubhendu Tripathi <shtri...@redhat.com> Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches