Ala Hino has uploaded a new change for review. Change subject: gluster: Warn instead of failing for unsupported gluster replica modes ......................................................................
gluster: Warn instead of failing for unsupported gluster replica modes A previous patch enforced the use of only supported gluster replication modes. If an unsupported mode was requested, the connection attempt would fail. Unfortunately, this was a bit heavy-handed and has resulted in breaking working environments during upgrade. To lessen the impact on users, instead of failing, log a warning. A related patch to ovirt-engine will warn users about the unsupported replication mode in the UI. Change-Id: I359e2405153f45b6ae303e00eb0e04a5ae14cb99 Signed-off-by: Ala Hino <ah...@redhat.com> Bug-Url: https://bugzilla.redhat.com/1286565 --- M tests/storageServerTests.py M vdsm/storage/storageServer.py 2 files changed, 6 insertions(+), 9 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/58/50258/1 diff --git a/tests/storageServerTests.py b/tests/storageServerTests.py index 70f71ca..13cb27e 100644 --- a/tests/storageServerTests.py +++ b/tests/storageServerTests.py @@ -25,7 +25,6 @@ from storage.storageServer import IscsiConnection from storage.storageServer import MountConnection from storage import storageServer -from storage import storage_exception as se class FakeSupervdsm(object): @@ -228,8 +227,8 @@ @MonkeyPatch(storageServer, 'supervdsm', FakeSupervdsm()) @MonkeyPatch(GlusterFSConnection, 'ALLOWED_REPLICA_COUNTS', ('1', '3')) - @permutations([['1', True], ['2', False], ['3', True], ['4', False]]) - def test_allowed_gluster_replica_count(self, replica_count, supported): + @permutations([['1'], ['2'], ['3'], ['4']]) + def test_allowed_gluster_replica_count(self, replica_count): def glusterVolumeInfo(volumeName=None, remoteServer=None): return {'music': {'replicaCount': replica_count}} @@ -237,8 +236,4 @@ storageServer.supervdsm.glusterVolumeInfo = glusterVolumeInfo gluster = GlusterFSConnection(spec="192.168.122.1:/music") - if supported: - gluster.validate() - else: - self.assertRaises(se.UnsupportedGlusterVolumeReplicaCountError, - gluster.validate) + gluster.validate() diff --git a/vdsm/storage/storageServer.py b/vdsm/storage/storageServer.py index 9f09aa4..35cf81e 100644 --- a/vdsm/storage/storageServer.py +++ b/vdsm/storage/storageServer.py @@ -334,7 +334,9 @@ def validate(self): replicaCount = self.volinfo['replicaCount'] if replicaCount not in self.ALLOWED_REPLICA_COUNTS: - raise se.UnsupportedGlusterVolumeReplicaCountError(replicaCount) + self.log.warning("Unsupported replica count (%s) for volume %r, " + "please upgrade volume to replica 3", + replicaCount, self._volname) def _get_backup_servers_option(self): servers = utils.unique(brick.split(":")[0] for brick -- To view, visit https://gerrit.ovirt.org/50258 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I359e2405153f45b6ae303e00eb0e04a5ae14cb99 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: ovirt-3.6 Gerrit-Owner: Ala Hino <ah...@redhat.com> _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches