There is some concern that with large numbers of volumes it will be
difficult for drivers to failover the host before the rpc timeout hits.
To avoid asking admins to bump the timeout just for these cases we can
switch it to do a non-blocking cast instead of call. The difference now
being that the active_backend_id is not returned from the API call to
failover-host. An admin will have to look at the service-list output
to see when it has changed states from ‘failing-over’ and then check
what its active_backend_id is at that time.
Change-Id: I69b4908fe783cf785d3e1612422fca15fea01c6f
Closes-Bug: #
1555342
elif id == "thaw":
return self._thaw(context, body['host'])
elif id == "failover_host":
- return self._failover(context,
- body['host'],
- body.get('backend_id',
- None))
+ self._failover(
+ context,
+ body['host'],
+ body.get('backend_id', None)
+ )
+ return webob.Response(status_int=202)
else:
raise webob.exc.HTTPNotFound(explanation=_("Unknown action"))
version='1.39')
def test_failover_host(self):
- self._test_volume_api('failover_host', rpc_method='call',
+ self._test_volume_api('failover_host', rpc_method='cast',
host='fake_host',
secondary_backend_id='fake_backend',
version='1.39')
% expected_status)
LOG.error(msg)
raise exception.InvalidInput(reason=msg)
- active_backend_id = self.volume_rpcapi.failover_host(
- ctxt, host,
- secondary_id)
- return active_backend_id
+ self.volume_rpcapi.failover_host(ctxt, host, secondary_id)
def freeze_host(self, ctxt, host):
:param context: security context
:param secondary_backend_id: Specifies backend_id to fail over to
- :returns : ID of the backend that was failed-over to
"""
svc_host = vol_utils.extract_host(self.host, 'backend')
"%(host)s invalid target ID %(backend_id)"),
{'host': self.host, 'backend_id':
secondary_backend_id})
- return None
+ return
if secondary_backend_id == "default":
service.replication_status = fields.ReplicationStatus.ENABLED
vobj.save()
LOG.info(_LI("Failed over to replication target successfully."))
- return active_backend_id
def freeze_host(self, context):
"""Freeze management plane on this backend.
secondary_backend_id=None):
"""Failover host to the specified backend_id (secondary). """
cctxt = self._get_cctxt(host, '1.39')
- return cctxt.call(ctxt, 'failover_host',
- secondary_backend_id=secondary_backend_id)
+ cctxt.cast(ctxt, 'failover_host',
+ secondary_backend_id=secondary_backend_id)
def manage_existing_snapshot(self, ctxt, snapshot, ref, host):
cctxt = self._get_cctxt(host, '1.28')