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

Subscribers

People subscribed via source and target branches