Number of Rabbitmq queues is growing from failover to failover

Bug #1396688 reported by Bogdan Dobrelya
This bug report is a duplicate of:  Bug #1429124: Set RabbitMQ policies. Edit Remove
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Committed
High
Alexey Khivin
6.0.x
Won't Fix
High
Alexey Khivin
6.1.x
Fix Committed
High
Alexey Khivin

Bug Description

During the Cloud operation stage, some of controllers may go down and return back - as a planned downtime or as a sudden failure (and that could happen even more often in a case of a network flapping). This is OK from the HA cluster health perspective. But
the number of Rabbitmq queues grows every time Openstack services reconnect to the AMQP server. In a long time that could end up running out of any connection limits or a major performance issues.

For example, in the files attached you can see how initial amount of ~100 queues grew up to the 1500 after a 100 failovers.

Steps to reproduce:

1. Deploy any HA environment with at least 3 controllers and collect info about queues from any controller:
"rabbitmqctl list_queues pid name arguments | column -t"
2. Shutdown any controller non gracefully (or kill with -9 its beam process)
3. Wait until OSTF HA health check will pass w/o failures
4. Bring the 'failed' controller up again (or skip steps 4-5, if you have killed a beam process instead)
5. Wait until OSTF HA health check will pass w/o failures
6. Collect info about queues from any controller again and compare it with the previous results.
7. Wait for not less than 60 minutes and repeat steps 2-6.

As a result you will see that some of the queues created more than 1h ago with 'x-expires' set to 1h will persist.
That happens likely due to Openstack services do not release an unused or obsolete or temporary (uuid based) queues after a reconnect. Looks like this issue cannot be addressed by Fuel but should be addressed by Oslo.messaging instead.

{"build_id": "2014-11-20_18-11-27", "ostf_sha": "8be702d5cafcb78ac1d93e5fc27d9272cce4773e", "build_number": "121", "auth_required": true, "api": "1.0", "nailgun_sha": "e4c59607c852f1b3761ef06c9c348994c98a7269", "production": "docker", "fuelmain_sha": "3a6833b3e5223c8eacadb1a0a22600813419e9a9", "astute_sha": "46d23177f9c0e53fb7a4729f394d9841b1bae338", "feature_groups": ["mirantis"], "release": "6.0", "release_versions": {"2014.2-6.0": {"VERSION": {"build_id": "2014-11-20_18-11-27", "ostf_sha": "8be702d5cafcb78ac1d93e5fc27d9272cce4773e", "build_number": "121", "api": "1.0", "nailgun_sha": "e4c59607c852f1b3761ef06c9c348994c98a7269", "production": "docker", "fuelmain_sha": "3a6833b3e5223c8eacadb1a0a22600813419e9a9", "astute_sha": "46d23177f9c0e53fb7a4729f394d9841b1bae338", "feature_groups": ["mirantis"], "release": "6.0", "fuellib_sha": "666c40d0f5c0bb3dbeaa02b7ba62d038453bae0f"}}}, "fuellib_sha": "666c40d0f5c0bb3dbeaa02b7ba62d038453bae0f"}

Revision history for this message
Bogdan Dobrelya (bogdando) wrote :
Changed in fuel:
milestone: none → 6.1
importance: Undecided → High
assignee: nobody → MOS Oslo (mos-oslo)
Revision history for this message
Bogdan Dobrelya (bogdando) wrote :
Revision history for this message
Bogdan Dobrelya (bogdando) wrote :
Revision history for this message
Bogdan Dobrelya (bogdando) wrote :

Here is a script output for 5 controllers cluster tested by ~100 failovers.
1st number represents a number of a channels, 2nd number - a number of queues.

Changed in fuel:
status: New → Confirmed
tags: added: release-notes
Revision history for this message
Dmitry Mescheryakov (dmitrymex) wrote :

Moving to the next release as the issue seem to be not that important and we're far beyond HCF

Revision history for this message
Alexey Khivin (akhivin) wrote :

The first assumption that I can make is the so-called "Forgotten acknowledgment" is the reason of this error

https://www.rabbitmq.com/tutorials/tutorial-two-python.html
See "Message acknowledgment" part

   ch.basic_ack(delivery_tag = method.delivery_tag)
..

Forgotten acknowledgment

It's a common mistake to miss the basic_ack. It's an easy error, but the consequences are serious. Messages will be redelivered when your client quits (which may look like random redelivery), but RabbitMQ will eat more and more memory as it won't be able to release any unacked messages.

In order to debug this kind of mistake you can use rabbitmqctl to print the messages_unacknowledged field:

$ sudo rabbitmqctl list_queues name messages_ready messages_unacknowledged
Listing queues ...
hello 0 0
...done.

Revision history for this message
Alexey Khivin (akhivin) wrote :

the first investigation results

each time when computational node have been rebooted, four new queues created

The list of names and parameters of these queues

7bbe5291-5d97-4925-b82b-dd0db4d9d91f [{"x-ha-policy","all"}]
7bbe5291-5d97-4925-b82b-dd0db4d9d91f.node-2.domain.tld [{"x-ha-policy","all"}]
7bbe5291-5d97-4925-b82b-dd0db4d9d91f_fanout_6d816a4d71ba40eda092e5b61fd45837 [{"x-ha-policy","all"}]
engine_fanout_643bcfcbf58c4cc4b98f31d7b70d2a63 [{"x-ha-policy","all"}]

this queues created without using the "x-expires" parameter and so they will not be deleted automatically

Revision history for this message
OSCI Robot (oscirobot) wrote :

RPM package oslo.messaging has been built for project openstack/oslo.messaging
Package version == 1.4.1, package release == fuel6.0.1.mira21.git.abf6e09.ae0dd8f

Changeset: https://review.fuel-infra.org/1855
project: openstack/oslo.messaging
branch: openstack-ci/fuel-6.0.1/2014.2
author: Alex Khivin
committer: Alex Khivin
subject: fixed: Number of Rabbitmq queues is growing from failover to failover Closes-Bug: #1396688 Change-Id: Iddd2fa061d1bb7d345d4344695cb9082b73831ad
status: patchset-created

Files placed on repository:
python-oslo-messaging-1.4.1-fuel6.0.1.mira21.git.abf6e09.ae0dd8f.noarch.rpm
python-oslo-messaging-doc-1.4.1-fuel6.0.1.mira21.git.abf6e09.ae0dd8f.noarch.rpm

NOTE: Changeset is not merged, created temporary package repository.
RPM repository URL: http://osci-obs.vm.mirantis.net:82/centos-fuel-6.0.1-stable-1855/centos

Revision history for this message
OSCI Robot (oscirobot) wrote :

DEB package oslo.messaging has been built for project openstack/oslo.messaging
Package version == 1.4.1, package release == fuel6.0.1~mira19+git.abf6e09.ae0dd8f

Changeset: https://review.fuel-infra.org/1855
project: openstack/oslo.messaging
branch: openstack-ci/fuel-6.0.1/2014.2
author: Alex Khivin
committer: Alex Khivin
subject: fixed: Number of Rabbitmq queues is growing from failover to failover Closes-Bug: #1396688 Change-Id: Iddd2fa061d1bb7d345d4344695cb9082b73831ad
status: patchset-created

Files placed on repository:
python-oslo.messaging_1.4.1-fuel6.0.1~mira19+git.abf6e09.ae0dd8f_all.deb

NOTE: Changeset is not merged, created temporary package repository.
DEB repository URL: http://osci-obs.vm.mirantis.net:82/ubuntu-fuel-6.0.1-stable-1855/ubuntu

Revision history for this message
OSCI Robot (oscirobot) wrote :

RPM package oslo.messaging has been built for project openstack/oslo.messaging
Package version == 1.4.1, package release == fuel6.1.mira21.git.e497ae5.ae0dd8f

Changeset: https://review.fuel-infra.org/1857
project: openstack/oslo.messaging
branch: openstack-ci/fuel-6.1/2014.2
author: Alex Khivin
committer: Alex Khivin
subject: fixed: Number of Rabbitmq queues is growing from failover to failover Closes-Bug: #1396688 Change-Id: Iddd2fa061d1bb7d345d4344695cb9082b73831ad
status: patchset-created

Files placed on repository:
python-oslo-messaging-1.4.1-fuel6.1.mira21.git.e497ae5.ae0dd8f.noarch.rpm
python-oslo-messaging-doc-1.4.1-fuel6.1.mira21.git.e497ae5.ae0dd8f.noarch.rpm

NOTE: Changeset is not merged, created temporary package repository.
RPM repository URL: http://osci-obs.vm.mirantis.net:82/centos-fuel-6.1-stable-1857/centos

Revision history for this message
OSCI Robot (oscirobot) wrote :

DEB package oslo.messaging has been built for project openstack/oslo.messaging
Package version == 1.4.1, package release == fuel6.1~mira19+git.e497ae5.ae0dd8f

Changeset: https://review.fuel-infra.org/1857
project: openstack/oslo.messaging
branch: openstack-ci/fuel-6.1/2014.2
author: Alex Khivin
committer: Alex Khivin
subject: fixed: Number of Rabbitmq queues is growing from failover to failover Closes-Bug: #1396688 Change-Id: Iddd2fa061d1bb7d345d4344695cb9082b73831ad
status: patchset-created

Files placed on repository:
python-oslo.messaging_1.4.1-fuel6.1~mira19+git.e497ae5.ae0dd8f_all.deb

NOTE: Changeset is not merged, created temporary package repository.
DEB repository URL: http://osci-obs.vm.mirantis.net:82/ubuntu-fuel-6.1-stable-1857/ubuntu

Revision history for this message
OSCI Robot (oscirobot) wrote :

RPM package oslo.messaging has been built for project openstack/oslo.messaging
Package version == 1.4.1, package release == fuel6.1.mira21.git.2fa4dd0.ae0dd8f

Changeset: https://review.fuel-infra.org/1857
project: openstack/oslo.messaging
branch: openstack-ci/fuel-6.1/2014.2
author: Alex Khivin
committer: Alex Khivin
subject: fixed: Number of Rabbitmq queues is growing from failover to failover
status: patchset-created

Files placed on repository:
python-oslo-messaging-1.4.1-fuel6.1.mira21.git.2fa4dd0.ae0dd8f.noarch.rpm
python-oslo-messaging-doc-1.4.1-fuel6.1.mira21.git.2fa4dd0.ae0dd8f.noarch.rpm

NOTE: Changeset is not merged, created temporary package repository.
RPM repository URL: http://osci-obs.vm.mirantis.net:82/centos-fuel-6.1-stable-1857/centos

Revision history for this message
OSCI Robot (oscirobot) wrote :

DEB package oslo.messaging has been built for project openstack/oslo.messaging
Package version == 1.4.1, package release == fuel6.1~mira19+git.2fa4dd0.ae0dd8f

Changeset: https://review.fuel-infra.org/1857
project: openstack/oslo.messaging
branch: openstack-ci/fuel-6.1/2014.2
author: Alex Khivin
committer: Alex Khivin
subject: fixed: Number of Rabbitmq queues is growing from failover to failover
status: patchset-created

Files placed on repository:
python-oslo.messaging_1.4.1-fuel6.1~mira19+git.2fa4dd0.ae0dd8f_all.deb

NOTE: Changeset is not merged, created temporary package repository.
DEB repository URL: http://osci-obs.vm.mirantis.net:82/ubuntu-fuel-6.1-stable-1857/ubuntu

Revision history for this message
OSCI Robot (oscirobot) wrote :

RPM package oslo.messaging has been built for project openstack/oslo.messaging
Package version == 1.4.1, package release == fuel6.0.1.mira21.git.ed0b89f.ae0dd8f

Changeset: https://review.fuel-infra.org/1855
project: openstack/oslo.messaging
branch: openstack-ci/fuel-6.0.1/2014.2
author: Alex Khivin
committer: Alex Khivin
subject: fixed: Number of Rabbitmq queues is growing from failover to failover
status: patchset-created

Files placed on repository:
python-oslo-messaging-1.4.1-fuel6.0.1.mira21.git.ed0b89f.ae0dd8f.noarch.rpm
python-oslo-messaging-doc-1.4.1-fuel6.0.1.mira21.git.ed0b89f.ae0dd8f.noarch.rpm

NOTE: Changeset is not merged, created temporary package repository.
RPM repository URL: http://osci-obs.vm.mirantis.net:82/centos-fuel-6.0.1-stable-1855/centos

Revision history for this message
OSCI Robot (oscirobot) wrote :

DEB package oslo.messaging has been built for project openstack/oslo.messaging
Package version == 1.4.1, package release == fuel6.0.1~mira19+git.ed0b89f.ae0dd8f

Changeset: https://review.fuel-infra.org/1855
project: openstack/oslo.messaging
branch: openstack-ci/fuel-6.0.1/2014.2
author: Alex Khivin
committer: Alex Khivin
subject: fixed: Number of Rabbitmq queues is growing from failover to failover
status: patchset-created

Files placed on repository:
python-oslo.messaging_1.4.1-fuel6.0.1~mira19+git.ed0b89f.ae0dd8f_all.deb

NOTE: Changeset is not merged, created temporary package repository.
DEB repository URL: http://osci-obs.vm.mirantis.net:82/ubuntu-fuel-6.0.1-stable-1855/ubuntu

Revision history for this message
OSCI Robot (oscirobot) wrote :

RPM package oslo.messaging has been built for project openstack/oslo.messaging
Package version == 1.4.1, package release == fuel6.1.mira21.git.7f7d665.ae0dd8f

Changeset: https://review.fuel-infra.org/1857
project: openstack/oslo.messaging
branch: openstack-ci/fuel-6.1/2014.2
author: Alex Khivin
committer: Alex Khivin
subject: fixed: Number of Rabbitmq queues is growing from failover to failover
status: patchset-created

Files placed on repository:
python-oslo-messaging-1.4.1-fuel6.1.mira21.git.7f7d665.ae0dd8f.noarch.rpm
python-oslo-messaging-doc-1.4.1-fuel6.1.mira21.git.7f7d665.ae0dd8f.noarch.rpm

NOTE: Changeset is not merged, created temporary package repository.
RPM repository URL: http://osci-obs.vm.mirantis.net:82/centos-fuel-6.1-stable-1857/centos

Revision history for this message
OSCI Robot (oscirobot) wrote :

DEB package oslo.messaging has been built for project openstack/oslo.messaging
Package version == 1.4.1, package release == fuel6.1~mira19+git.7f7d665.ae0dd8f

Changeset: https://review.fuel-infra.org/1857
project: openstack/oslo.messaging
branch: openstack-ci/fuel-6.1/2014.2
author: Alex Khivin
committer: Alex Khivin
subject: fixed: Number of Rabbitmq queues is growing from failover to failover
status: patchset-created

Files placed on repository:
python-oslo.messaging_1.4.1-fuel6.1~mira19+git.7f7d665.ae0dd8f_all.deb

NOTE: Changeset is not merged, created temporary package repository.
DEB repository URL: http://osci-obs.vm.mirantis.net:82/ubuntu-fuel-6.1-stable-1857/ubuntu

Revision history for this message
OSCI Robot (oscirobot) wrote :

RPM package oslo.messaging has been built for project openstack/oslo.messaging
Package version == 1.4.1, package release == fuel6.0.1.mira21.git.265a0b7.ae0dd8f

Changeset: https://review.fuel-infra.org/1855
project: openstack/oslo.messaging
branch: openstack-ci/fuel-6.0.1/2014.2
author: Alex Khivin
committer: Alex Khivin
subject: fixed: Number of Rabbitmq queues is growing from failover to failover
status: patchset-created

Files placed on repository:
python-oslo-messaging-1.4.1-fuel6.0.1.mira21.git.265a0b7.ae0dd8f.noarch.rpm
python-oslo-messaging-doc-1.4.1-fuel6.0.1.mira21.git.265a0b7.ae0dd8f.noarch.rpm

NOTE: Changeset is not merged, created temporary package repository.
RPM repository URL: http://osci-obs.vm.mirantis.net:82/centos-fuel-6.0.1-stable-1855/centos

Revision history for this message
OSCI Robot (oscirobot) wrote :

DEB package oslo.messaging has been built for project openstack/oslo.messaging
Package version == 1.4.1, package release == fuel6.0.1~mira19+git.265a0b7.ae0dd8f

Changeset: https://review.fuel-infra.org/1855
project: openstack/oslo.messaging
branch: openstack-ci/fuel-6.0.1/2014.2
author: Alex Khivin
committer: Alex Khivin
subject: fixed: Number of Rabbitmq queues is growing from failover to failover
status: patchset-created

Files placed on repository:
python-oslo.messaging_1.4.1-fuel6.0.1~mira19+git.265a0b7.ae0dd8f_all.deb

NOTE: Changeset is not merged, created temporary package repository.
DEB repository URL: http://osci-obs.vm.mirantis.net:82/ubuntu-fuel-6.0.1-stable-1855/ubuntu

Revision history for this message
OSCI Robot (oscirobot) wrote :

RPM package oslo.messaging has been built for project openstack/oslo.messaging
Package version == 1.4.1, package release == fuel6.0.1.mira21.git.1883e23.ae0dd8f

Changeset: https://review.fuel-infra.org/1855
project: openstack/oslo.messaging
branch: openstack-ci/fuel-6.0.1/2014.2
author: Alex Khivin
committer: Pekelny Ilya
subject: Number of Rabbitmq queues is growing from failover to failover
status: patchset-created

Files placed on repository:
python-oslo-messaging-1.4.1-fuel6.0.1.mira21.git.1883e23.ae0dd8f.noarch.rpm
python-oslo-messaging-doc-1.4.1-fuel6.0.1.mira21.git.1883e23.ae0dd8f.noarch.rpm

NOTE: Changeset is not merged, created temporary package repository.
RPM repository URL: http://osci-obs.vm.mirantis.net:82/centos-fuel-6.0.1-stable-1855/centos

Revision history for this message
OSCI Robot (oscirobot) wrote :

DEB package oslo.messaging has been built for project openstack/oslo.messaging
Package version == 1.4.1, package release == fuel6.0.1~mira19+git.1883e23.ae0dd8f

Changeset: https://review.fuel-infra.org/1855
project: openstack/oslo.messaging
branch: openstack-ci/fuel-6.0.1/2014.2
author: Alex Khivin
committer: Pekelny Ilya
subject: Number of Rabbitmq queues is growing from failover to failover
status: patchset-created

Files placed on repository:
python-oslo.messaging_1.4.1-fuel6.0.1~mira19+git.1883e23.ae0dd8f_all.deb

NOTE: Changeset is not merged, created temporary package repository.
DEB repository URL: http://osci-obs.vm.mirantis.net:82/ubuntu-fuel-6.0.1-stable-1855/ubuntu

Revision history for this message
OSCI Robot (oscirobot) wrote :

RPM package oslo.messaging has been built for project openstack/oslo.messaging
Package version == 1.4.1, package release == fuel6.1.mira21.git.05b5070.ae0dd8f

Changeset: https://review.fuel-infra.org/1857
project: openstack/oslo.messaging
branch: openstack-ci/fuel-6.1/2014.2
author: Alex Khivin
committer: Alex Khivin
subject: Number of Rabbitmq queues is growing from failover to failover
status: patchset-created

Files placed on repository:
python-oslo-messaging-1.4.1-fuel6.1.mira21.git.05b5070.ae0dd8f.noarch.rpm
python-oslo-messaging-doc-1.4.1-fuel6.1.mira21.git.05b5070.ae0dd8f.noarch.rpm

NOTE: Changeset is not merged, created temporary package repository.
RPM repository URL: http://osci-obs.vm.mirantis.net:82/centos-fuel-6.1-stable-1857/centos

Revision history for this message
OSCI Robot (oscirobot) wrote :

DEB package oslo.messaging has been built for project openstack/oslo.messaging
Package version == 1.4.1, package release == fuel6.1~mira19+git.05b5070.ae0dd8f

Changeset: https://review.fuel-infra.org/1857
project: openstack/oslo.messaging
branch: openstack-ci/fuel-6.1/2014.2
author: Alex Khivin
committer: Alex Khivin
subject: Number of Rabbitmq queues is growing from failover to failover
status: patchset-created

Files placed on repository:
python-oslo.messaging_1.4.1-fuel6.1~mira19+git.05b5070.ae0dd8f_all.deb

NOTE: Changeset is not merged, created temporary package repository.
DEB repository URL: http://osci-obs.vm.mirantis.net:82/ubuntu-fuel-6.1-stable-1857/ubuntu

Revision history for this message
OSCI Robot (oscirobot) wrote :

RPM package oslo.messaging has been built for project openstack/oslo.messaging
Package version == 1.4.1, package release == fuel6.1.mira21.git.2b17c31.ae0dd8f

Changeset: https://review.fuel-infra.org/1857
project: openstack/oslo.messaging
branch: openstack-ci/fuel-6.1/2014.2
author: Alex Khivin
committer: Pekelny Ilya
subject: Number of Rabbitmq queues is growing from failover to failover
status: patchset-created

Files placed on repository:
python-oslo-messaging-1.4.1-fuel6.1.mira21.git.2b17c31.ae0dd8f.noarch.rpm
python-oslo-messaging-doc-1.4.1-fuel6.1.mira21.git.2b17c31.ae0dd8f.noarch.rpm

NOTE: Changeset is not merged, created temporary package repository.
RPM repository URL: http://osci-obs.vm.mirantis.net:82/centos-fuel-6.1-stable-1857/centos

Revision history for this message
OSCI Robot (oscirobot) wrote :

DEB package oslo.messaging has been built for project openstack/oslo.messaging
Package version == 1.4.1, package release == fuel6.1~mira19+git.2b17c31.ae0dd8f

Changeset: https://review.fuel-infra.org/1857
project: openstack/oslo.messaging
branch: openstack-ci/fuel-6.1/2014.2
author: Alex Khivin
committer: Pekelny Ilya
subject: Number of Rabbitmq queues is growing from failover to failover
status: patchset-created

Files placed on repository:
python-oslo.messaging_1.4.1-fuel6.1~mira19+git.2b17c31.ae0dd8f_all.deb

NOTE: Changeset is not merged, created temporary package repository.
DEB repository URL: http://osci-obs.vm.mirantis.net:82/ubuntu-fuel-6.1-stable-1857/ubuntu

Revision history for this message
OSCI Robot (oscirobot) wrote :

RPM package oslo.messaging has been built for project openstack/oslo.messaging
Package version == 1.4.1, package release == fuel6.1.mira21

Changeset: https://review.fuel-infra.org/1857
project: openstack/oslo.messaging
branch: openstack-ci/fuel-6.1/2014.2
author: Alex Khivin
committer: Pekelny Ilya
subject: Number of Rabbitmq queues is growing from failover to failover
status: change-merged

Files placed on repository:
python-oslo-messaging-1.4.1-fuel6.1.mira21.noarch.rpm
python-oslo-messaging-doc-1.4.1-fuel6.1.mira21.noarch.rpm

Changeset merged. Package placed on primary repository
RPM repository URL: http://osci-obs.vm.mirantis.net:82/centos-fuel-6.1-stable/centos

Revision history for this message
OSCI Robot (oscirobot) wrote :

RPM package oslo.messaging has been built for project openstack/oslo.messaging
Package version == 1.4.1, package release == fuel6.0.1.mira21

Changeset: https://review.fuel-infra.org/1855
project: openstack/oslo.messaging
branch: openstack-ci/fuel-6.0.1/2014.2
author: Alex Khivin
committer: Pekelny Ilya
subject: Number of Rabbitmq queues is growing from failover to failover
status: change-merged

Files placed on repository:
python-oslo-messaging-1.4.1-fuel6.0.1.mira21.noarch.rpm
python-oslo-messaging-doc-1.4.1-fuel6.0.1.mira21.noarch.rpm

Changeset merged. Package placed on primary repository
RPM repository URL: http://osci-obs.vm.mirantis.net:82/centos-fuel-6.0.1-stable/centos

Revision history for this message
OSCI Robot (oscirobot) wrote :

DEB package oslo.messaging has been built for project openstack/oslo.messaging
Package version == 1.4.1, package release == fuel6.1~mira19

Changeset: https://review.fuel-infra.org/1857
project: openstack/oslo.messaging
branch: openstack-ci/fuel-6.1/2014.2
author: Alex Khivin
committer: Pekelny Ilya
subject: Number of Rabbitmq queues is growing from failover to failover
status: change-merged

Files placed on repository:
python-oslo.messaging_1.4.1-fuel6.1~mira19_all.deb

Changeset merged. Package placed on primary repository
DEB repository URL: http://osci-obs.vm.mirantis.net:82/ubuntu-fuel-6.1-stable/ubuntu

Revision history for this message
OSCI Robot (oscirobot) wrote :

DEB package oslo.messaging has been built for project openstack/oslo.messaging
Package version == 1.4.1, package release == fuel6.0.1~mira19

Changeset: https://review.fuel-infra.org/1855
project: openstack/oslo.messaging
branch: openstack-ci/fuel-6.0.1/2014.2
author: Alex Khivin
committer: Pekelny Ilya
subject: Number of Rabbitmq queues is growing from failover to failover
status: change-merged

Files placed on repository:
python-oslo.messaging_1.4.1-fuel6.0.1~mira19_all.deb

Changeset merged. Package placed on primary repository
DEB repository URL: http://osci-obs.vm.mirantis.net:82/ubuntu-fuel-6.0.1-stable/ubuntu

Revision history for this message
Ilya Pekelny (i159) wrote :

In short, auto-delete queues can be deleted too early and it causes lose of messages in failover scenarios. This was fixed by replacing auto_delete with x-expires. But the side effect of that fix was that queues which were not deleted manually were deleted with one hour delay (instead of immediately after failover, as it was before). So the number of queues do grow after failover but unused will be deleted automatically within a hours and should not caused problems (until you have 1000 failovers per second).

Revision history for this message
Alexey Khivin (akhivin) wrote :

So
there are queues with the names like

b21828bd-80c3-4abf-8f50-0ffd71671d6b
b21828bd-80c3-4abf-8f50-0ffd71671d6b.node-4

which are auto_delete=False and have no "x-expires" attribute

These queues created every time when controller restarted. There is no telling which component created these queues

Revision history for this message
Alexey Khivin (akhivin) wrote :

A little more information

On every start Heat creates 4 queues with no "auto_delete" and "x-expire" options

with the name like

b21828bd-80c3-4abf-8f50-0ffd71671d6b
b21828bd-80c3-4abf-8f50-0ffd71671d6b.node-4
engine
engine.node-4

two of them have contant names and other two have random names.
So, the number of randomly named queues increases every time the Heat restarts

Revision history for this message
Bogdan Dobrelya (bogdando) wrote :

Thanks for researching this. So, It looks like a heat issue to be resolved?

Revision history for this message
Alexey Khivin (akhivin) wrote :

I created https://bugs.launchpad.net/oslo.messaging/+bug/1414674 just to discuss with the comunity

As i understand now, setting amqp_auto_delete to True in the oslo_config should be solution of this issue

Revision history for this message
Bogdan Dobrelya (bogdando) wrote :

I tested amqp_auto_delete with nova.conf and it looks like exchanges and queues have to be recreated by Oslo messaging code, otherwise there are would be errors like:

{amqp_error,precondition_failed,
            "cannot redeclare exchange 'nova' in vhost '/' with different type, durable, internal or autodelete value",
            'exchange.declare'}

Revision history for this message
Alexey Khivin (akhivin) wrote :

Nova is not the same as Heat, but you a right changing the global option may produce unexpected results.
At the same time it seems it is not so simple to change auto_delete option for the one particular queue in Heat because of the oslo.messaging api

Revision history for this message
Alexey Khivin (akhivin) wrote :

My offer is to downgrade the status of this bug to the medium level

this bug may hardly be the reason of cloud failure. Even if the number of these randomly named queues will be thousands then nothing will happen

Revision history for this message
Bogdan Dobrelya (bogdando) wrote :

RabbitMQ cluster may degrade in performance in this case. And multiple AMQP connection fail overs may occur for a network flapping case, which I believe is quite a common thing.

Revision history for this message
Alexey Khivin (akhivin) wrote :

upstream patch which closes https://bugs.launchpad.net/oslo.messaging/+bug/1414674 was merged into 6.1 branch

Revision history for this message
Alexey Khivin (akhivin) wrote :

sorry, not merged yet

Revision history for this message
Alexey Khivin (akhivin) wrote :

This patch reduces number of the random named queues in Heat
https://review.openstack.org/#/c/159876/

so it should be backported

Revision history for this message
Alexey Khivin (akhivin) wrote :

 As rabbit-specific changes are not welcomed in oslo.messaging and nobody wants add new parameters for rpc functions in oslo so I suggest to use rabbit policies

As example, these are different types of queues those should probably be removed after one hour of idleness

8e1b829a-e279-4301-b465-63f2da1afae2 (heat before patch)
8e1b829a-e279-4301-b465-63f2da1afae2.node-3 (heat before patch)
heat-engine-listener.6554eddc-bd69-4d5c-8cda-37ae4cb755d0 (heat after patch)
results.1ec377c1-07f4-4a46-964d-c26a9b9190ab (?)
tasks.6dfbb578-9b18-4ca5-95e9-021c734ce758 (?)

Thus, policy for each type of queues

rabbitmqctl set_policy expiry_heat "^heat-engine-listener\\." '{"expires":6000}' --apply-to all --priority 1
rabbitmqctl set_policy expiry_results "^results\\." '{"expires":3600000}' --apply-to all --priority 1
rabbitmqctl set_policy expiry_tasks "^tasks\\." '{"expires":3600000}' --apply-to all --priority 1
rabbitmqctl set_policy expiry_heat_old "^........-....-....-....-............" '{"expires":36000000}' --apply-to all --priority 1

priority 1 set to overwrite default 0 level policy in the fuel deployment

Revision history for this message
Alexey Khivin (akhivin) wrote :
Revision history for this message
Bogdan Dobrelya (bogdando) wrote :
Revision history for this message
Bogdan Dobrelya (bogdando) wrote :

For Fuel this bug is being tracked further as https://bugs.launchpad.net/fuel/+bug/1429124

tags: added: release-notes-done
removed: release-notes
Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Change abandoned on openstack/oslo.messaging (openstack-ci/fuel-7.0/2015.1.0)

Change abandoned by Alex Khivin <email address hidden> on branch: openstack-ci/fuel-7.0/2015.1.0
Review: https://review.fuel-infra.org/8278
Reason: This one has been reverted in the 6.1 branch and must not be merged into

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.