Merge lp:~hopem/nova/icehouse-lp1506257 into lp:~ubuntu-server-dev/nova/icehouse

Proposed by Edward Hope-Morley
Status: Approved
Approved by: Corey Bryant
Approved revision: 707
Proposed branch: lp:~hopem/nova/icehouse-lp1506257
Merge into: lp:~ubuntu-server-dev/nova/icehouse
Diff against target: 74 lines (+54/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/protect-against-upgrade-rpc-ver-mismatch.patch (+46/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~hopem/nova/icehouse-lp1506257
Reviewer Review Type Date Requested Status
Ubuntu Server Developers Pending
Review via email: mp+274493@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Corey Bryant (corey.bryant) wrote :

Thanks Ed. I merged the diff from launchpad instead since the changelog signature had a different time stamp. https://launchpadlibrarian.net/222055256/nova_1%3A2014.1.5-0ubuntu1.3_1%3A2014.1.5-0ubuntu1.4.diff.gz

Unmerged revisions

707. By Edward Hope-Morley

* Protect against possible rpcapi mismatch on upgrade (LP: #1506257)
  - d/p/protect-against-upgrade-rpc-ver-mismatch.patch

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2015-09-08 14:45:33 +0000
+++ debian/changelog 2015-10-15 00:52:16 +0000
@@ -1,3 +1,10 @@
1nova (1:2014.1.5-0ubuntu1.4) UNRELEASED; urgency=medium
2
3 * Protect against possible rpcapi mismatch on upgrade (LP: #1506257)
4 - d/p/protect-against-upgrade-rpc-ver-mismatch.patch
5
6 -- Edward Hope-Morley <edward.hope-morley@canonical.com> Wed, 14 Oct 2015 17:32:40 -0700
7
1nova (1:2014.1.5-0ubuntu1.3) trusty; urgency=medium8nova (1:2014.1.5-0ubuntu1.3) trusty; urgency=medium
29
3 * Attempting to attach the same volume multiple times can cause10 * Attempting to attach the same volume multiple times can cause
411
=== added file 'debian/patches/protect-against-upgrade-rpc-ver-mismatch.patch'
--- debian/patches/protect-against-upgrade-rpc-ver-mismatch.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/protect-against-upgrade-rpc-ver-mismatch.patch 2015-10-15 00:52:16 +0000
@@ -0,0 +1,46 @@
1diff --git a/nova/compute/rpcapi.py b/nova/compute/rpcapi.py
2index 2e39fd9..0b4eabe 100644
3--- a/nova/compute/rpcapi.py
4+++ b/nova/compute/rpcapi.py
5@@ -816,6 +816,25 @@ class ComputeAPI(object):
6 cctxt = self.client.prepare(server=host, version=version)
7 return cctxt.call(ctxt, 'get_host_uptime')
8
9+ def _reserve_block_device_name(self, ctxt, instance, device, volume_id,
10+ disk_bus=None, device_type=None):
11+ version = '3.16'
12+ kw = {'instance': instance, 'device': device,
13+ 'volume_id': volume_id, 'disk_bus': disk_bus,
14+ 'device_type': device_type}
15+
16+ if not self.client.can_send_version(version):
17+ # NOTE(russellb) Havana compat
18+ version = self._get_compat_version('3.0', '2.3')
19+ kw['instance'] = jsonutils.to_primitive(
20+ objects_base.obj_to_primitive(instance))
21+ del kw['disk_bus']
22+ del kw['device_type']
23+
24+ cctxt = self.client.prepare(server=_compute_host(None, instance),
25+ version=version)
26+ return cctxt.call(ctxt, 'reserve_block_device_name', **kw)
27+
28 def reserve_block_device_name(self, ctxt, instance, device, volume_id,
29 disk_bus=None, device_type=None):
30 kw = {'instance': instance, 'device': device,
31@@ -829,7 +848,14 @@ class ComputeAPI(object):
32
33 cctxt = self.client.prepare(server=_compute_host(None, instance),
34 version=version)
35- volume_bdm = cctxt.call(ctxt, 'reserve_block_device_name', **kw)
36+ try:
37+ volume_bdm = cctxt.call(ctxt, 'reserve_block_device_name', **kw)
38+ except messaging.rpc.client.RemoteError:
39+ # NOTE(dosaboy): catch rpc api version mismatch (see bug 1506257)
40+ volume_bdm = self._reserve_block_device_name(ctxt, instance,
41+ device, volume_id,
42+ disk_bus, device_type)
43+
44 if not isinstance(volume_bdm, block_device_obj.BlockDeviceMapping):
45 volume_bdm = block_device_obj.BlockDeviceMapping.get_by_volume_id(
46 ctxt, volume_id)
047
=== modified file 'debian/patches/series'
--- debian/patches/series 2015-09-08 14:45:33 +0000
+++ debian/patches/series 2015-10-15 00:52:16 +0000
@@ -7,3 +7,4 @@
7add-support-for-syslog-connect-retries.patch7add-support-for-syslog-connect-retries.patch
8clean-shutdown.patch8clean-shutdown.patch
9fix-creating-bdm-for-failed-volume-attachment.patch9fix-creating-bdm-for-failed-volume-attachment.patch
10protect-against-upgrade-rpc-ver-mismatch.patch

Subscribers

People subscribed via source and target branches