Bug 1312962

Summary: rabbitmq configuration in rabbitmq.config is generated with two different tcp_listen_options sections
Product: Red Hat OpenStack Reporter: Marian Krcmarik <mkrcmari>
Component: openstack-tripleo-heat-templatesAssignee: Michele Baldessari <michele>
Status: CLOSED ERRATA QA Contact: Udi Shkalim <ushkalim>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0 (Liberty)CC: athomas, dbecker, dmacpher, fdinitto, jcoufal, jschluet, mburns, mcornea, michele, morazi, plemenko, rhel-osp-director-maint, rscarazz
Target Milestone: Upstream M3Keywords: InstallerIntegration, Triaged
Target Release: 11.0 (Ocata)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-tripleo-heat-templates-6.0.0-3 Doc Type: Bug Fix
Doc Text:
The director set the 'tcp_list_options' stanza twice in '/etc/rabbitmq/rabbitmq.config'. This caused no adverse effects but could cause confusion in the future. This fix removes the redundant stanza. Only one 'tcp_list_options' stanza now appears in the configuration file.
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-05-17 19:27:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Marian Krcmarik 2016-02-29 16:05:57 UTC
Description of problem:
Openstack deployed by OSP-d has on all controller nodes autogenerated config file for rabbitmq with wrong values - specifically It contains tcp_listen_options section twice, first entry without keepalive option enabled and second with keepalived enabled, afaik first entry is only read and set in erlang configs. The goal is to have keepalive enabled which will not happen afaik with configuration generated by OSPd for rabbitmq server.

Example of rabbitmq.config after clean deploy:
% This file managed by Puppet
% Template Path: rabbitmq/templates/rabbitmq.config
[
  {rabbit, [
    {tcp_listen_options,
         [binary,
         {packet,        raw},
         {reuseaddr,     true},
         {backlog,       128},
         {nodelay,       true},
         {exit_on_close, false}]
    },
    {cluster_partition_handling, pause_minority},
    {tcp_listen_options, [binary, {packet, raw}, {reuseaddr, true}, {backlog, 128}, {nodelay, true}, {exit_on_close, false}, {keepalive, true}]},
    {default_user, <<"guest">>},
    {default_pass, <<"guest">>}
  ]},
  {kernel, [
    {inet_dist_listen_max, 35672},
    {inet_dist_listen_min, 35672}
  ]}
,
  {rabbitmq_management, [
    {listener, [
      {port, 15672}
    ]}
  ]}
].

and It should look like for example as:
% This file managed by Puppet
% Template Path: rabbitmq/templates/rabbitmq.config
[
  {rabbit, [
    {tcp_listen_options,
         [binary,
         {packet,        raw},
         {reuseaddr,     true},
         {backlog,       128},
         {nodelay,       true},
         {exit_on_close, false},
         {keepalive,     true}
       ]
    },
    {cluster_partition_handling, pause_minority},
    {default_user, <<"guest">>},
    {default_pass, <<"guest">>}
  ]},
  {kernel, [
    {inet_dist_listen_max, 35672},
    {inet_dist_listen_min, 35672}
  ]}
,
  {rabbitmq_management, [
    {listener, [
      {port, 15672}
    ]}
  ]}
].

Version-Release number of selected component (if applicable):
$ $ rpm -qa | grep tripleo
openstack-tripleo-image-elements-0.9.7-2.el7ost.noarch
openstack-tripleo-heat-templates-kilo-0.8.7-12.el7ost.noarch
openstack-tripleo-puppet-elements-0.0.2-1.el7ost.noarch
openstack-tripleo-heat-templates-0.8.7-12.el7ost.noarch
openstack-tripleo-0.0.7-1.el7ost.noarch
openstack-tripleo-common-0.1.1-1.el7ost.noarch
python-tripleoclient-0.1.1-2.el7ost.noarch

How reproducible:
Always

Steps to Reproduce:
1. grep tcp_listen_options /etc/rabbitmq/rabbitmq.config

Actual results:
2 entries

Expected results:
1 entry

Additional info:

Comment 2 Marian Krcmarik 2016-04-04 11:30:16 UTC
The configuration is not produced as It was the intention causing cluster to have longer recovery time.

Comment 3 Mike Burns 2016-04-07 21:11:06 UTC
This bug did not make the OSP 8.0 release.  It is being deferred to OSP 10.

Comment 4 Peter Lemenkov 2016-05-23 13:16:00 UTC
Ping, anyone :)
This looks very easy to fix so why keep this open?

Comment 5 Peter Lemenkov 2016-05-31 11:59:50 UTC
Ping, again :)
This looks very easy to fix, so let's just fix it :)

Comment 6 Michele Baldessari 2016-10-12 13:17:22 UTC
So the reason for this bug is the following. In puppet/services/rabbitmq.yaml we have the following:
rabbitmq_config_variables:
  tcp_listen_options: '[binary, {packet, raw}, {reuseaddr, true}, {backlog, 128}, {nodelay, true}, {exit_on_close, false}, {keepalive, true}]'


This rabbitmq_config_variables will simply populate the tcp_listen_option option in rabbitmq.config. The problem is that the puppet module for rabbit already contains the logic to set tcp_listen_options. Namely it does the following (templates/rabbitmq.config.erb):
   {tcp_listen_options,
        [binary,
        <%- if @tcp_keepalive -%>
        {keepalive,     true},
        <%- end -%>
        {packet,        raw},
        {reuseaddr,     true},
        <%- if @tcp_backlog -%>
        {backlog,       <%= @tcp_backlog %>},
        <%- end -%>
        <%- if @tcp_sndbuf -%>
        {sndbuf,       <%= @tcp_sndbuf %>},
        <%- end -%>
        <%- if @tcp_recbuf -%>
        {recbuf,       <%= @tcp_recbuf %>},
        <%- end -%>
        {nodelay,       true},
        {linger,        {true, 0}},
        {exit_on_close, false}]
   },


So what we need to verify if we remove that line from rabbitmq.yaml that we set the parameter tcp_sndbuf to 128 and that {linger, {true, 0}} is okay

Comment 9 errata-xmlrpc 2017-05-17 19:27:35 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2017:1245