Merge lp:~zhhuabj/charm-helpers/lp1685788 into lp:charm-helpers

Proposed by Hua Zhang
Status: Merged
Approved by: Alex Kavanagh
Approved revision: 758
Merged at revision: 761
Proposed branch: lp:~zhhuabj/charm-helpers/lp1685788
Merge into: lp:charm-helpers
Diff against target: 36 lines (+15/-0)
2 files modified
charmhelpers/contrib/openstack/context.py (+12/-0)
tests/contrib/openstack/test_os_contexts.py (+3/-0)
To merge this branch: bzr merge lp:~zhhuabj/charm-helpers/lp1685788
Reviewer Review Type Date Requested Status
Alex Kavanagh Approve
Review via email: mp+326824@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Alex Kavanagh (ajkavanagh) wrote :

This is going to need more of a commit/merge message please. Why are these being added? The bug report has more information, but it would be very useful to future readers of the commit history of charm-helpers why these were added here. It's also not clear which context class this is being added to. Thanks.

review: Needs Fixing
lp:~zhhuabj/charm-helpers/lp1685788 updated
758. By Hua Zhang

When the OpenStack clouds get bigger, more messaging transactions will happen,
which will cause more load on rabbitmq server. In order to mitigate this,
polling_interval rpc_response_timeout and report_interval values are important
to adjust accordingly to the size of OpenStack cluster.

So this patch supports setting those values in neutron-api centrally, then:

1, polling_interval
   neutron-openvswitch charm gets polling_interval via it's relations and set it
   in [agent] of ml2_conf.ini or openvswitch_agent.ini(>=Mitaka)

2, rpc_response_timeout
   neutron-gateway charm gets rpc_response_timeout via it's relations and set it
   in [default] of neutron.conf

3, report_interval
   Both neutron-openvswitch charm and neutron-gateway charm get report_interval
   via it's relations and set it in [agent] of neutron.conf

Thus we need to modifty charm-helpers to set those values in NeutronAPIContext,
too.

Revision history for this message
Hua Zhang (zhhuabj) wrote :

Hi Alex, I have updated commit/merge message, thanks for the review.

Revision history for this message
Alex Kavanagh (ajkavanagh) wrote :

The commit message now looks great. Thanks for fixing it up.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'charmhelpers/contrib/openstack/context.py'
2--- charmhelpers/contrib/openstack/context.py 2017-05-01 05:08:50 +0000
3+++ charmhelpers/contrib/openstack/context.py 2017-07-05 10:39:18 +0000
4@@ -1397,6 +1397,18 @@
5 'rel_key': 'dns-domain',
6 'default': None,
7 },
8+ 'polling_interval': {
9+ 'rel_key': 'polling-interval',
10+ 'default': 2,
11+ },
12+ 'rpc_response_timeout': {
13+ 'rel_key': 'rpc-response-timeout',
14+ 'default': 60,
15+ },
16+ 'report_interval': {
17+ 'rel_key': 'report-interval',
18+ 'default': 30,
19+ },
20 }
21 ctxt = self.get_neutron_options({})
22 for rid in relation_ids('neutron-plugin-api'):
23
24=== modified file 'tests/contrib/openstack/test_os_contexts.py'
25--- tests/contrib/openstack/test_os_contexts.py 2017-04-26 09:29:19 +0000
26+++ tests/contrib/openstack/test_os_contexts.py 2017-07-05 10:39:18 +0000
27@@ -3117,6 +3117,9 @@
28 api_ctxt = context.NeutronAPIContext()()
29 for key in expected_keys:
30 self.assertTrue(key in api_ctxt)
31+ self.assertEquals(api_ctxt['polling_interval'], 2)
32+ self.assertEquals(api_ctxt['rpc_response_timeout'], 60)
33+ self.assertEquals(api_ctxt['report_interval'], 30)
34
35 def test_neutronapicontext_string_converted(self):
36 self.relation_ids.return_value = ['neutron-plugin-api:1']

Subscribers

People subscribed via source and target branches