From ed613aa66fe37737ab97ce7e483949d931a0c3a5 Mon Sep 17 00:00:00 2001 From: Balazs Gibizer Date: Tue, 4 Jun 2019 10:36:45 +0200 Subject: [PATCH] Change the default of notification_format to unversioned The default config `both` means that both the legacy and the versioned notifications are emitted. This was selected as default in the past when we thought that this will help the adoption of the versioned interface while we worked on to make that new interface in feature parity with the legacy. Even though the versioned notification interface is in feature parity with the legacy interface since Stein the projects consuming nova notifications do not have the resources to switch to the new interface. In the other hand having `both` as a default in an environtment where only the legacy notifications are consumed causes performance issues in the message bus hence the bug #1805659. The original plan was that we set the default to `versioned` when the interface reaches feature parity but as major consumers are not ready to switch we cannot do that. So the only option left is to set the default to `unversioned`. Related devstack patch: https://review.opendev.org/#/c/662849/ Closes-Bug: #1805659 Change-Id: I72faa356afffb7a079a9ce86fed1b463773a0507 --- doc/source/reference/notifications.rst | 4 +--- nova/conf/notifications.py | 14 ++++++++------ nova/tests/unit/conf_fixture.py | 4 ++++ ...fault-notification_format-f149db44b319aa07.yaml | 11 +++++++++++ 4 files changed, 24 insertions(+), 9 deletions(-) create mode 100644 releasenotes/notes/unversioned-as-default-notification_format-f149db44b319aa07.yaml diff --git a/doc/source/reference/notifications.rst b/doc/source/reference/notifications.rst index 76c113d2a716..d2223bb76789 100644 --- a/doc/source/reference/notifications.rst +++ b/doc/source/reference/notifications.rst @@ -113,9 +113,7 @@ notification payload: There is a Nova configuration parameter :oslo.config:option:`notifications.notification_format` -that can be used to specify which notifications are emitted by Nova. The -possible values are ``unversioned``, ``versioned``, ``both`` and the default -value is ``both``. +that can be used to specify which notifications are emitted by Nova. The versioned notifications are emitted to a different topic than the legacy notifications. By default they are emitted to 'versioned_notifications' but it diff --git a/nova/conf/notifications.py b/nova/conf/notifications.py index edde86880add..a5946ddb3c9d 100644 --- a/nova/conf/notifications.py +++ b/nova/conf/notifications.py @@ -57,7 +57,7 @@ additional information on notifications. help="Default notification level for outgoing notifications."), cfg.StrOpt( 'notification_format', - default='both', + default='unversioned', choices=[ ('both', 'Both the legacy unversioned and the new versioned ' 'notifications are emitted'), @@ -67,12 +67,14 @@ additional information on notifications. ], deprecated_group='DEFAULT', help=""" -Specifies which notification format shall be used by nova. +Specifies which notification format shall be emitted by nova. -The default value is fine for most deployments and rarely needs to be changed. -This value can be set to 'versioned' once the infrastructure moves closer to -consuming the newer format of notifications. After this occurs, this option -will be removed. +The versioned notification interface are in feature parity with the legacy +interface and the versioned interface is actively developed so new consumers +should used the versioned interface. + +However, the legacy interface is heavily used by ceilometer and other mature +OpenStack components so it remains the default. Note that notifications can be completely disabled by setting ``driver=noop`` in the ``[oslo_messaging_notifications]`` group. diff --git a/nova/tests/unit/conf_fixture.py b/nova/tests/unit/conf_fixture.py index c199c649b0e8..6e4f5a8ee2fa 100644 --- a/nova/tests/unit/conf_fixture.py +++ b/nova/tests/unit/conf_fixture.py @@ -77,6 +77,10 @@ class ConfFixture(config_fixture.Config): # tests. self.conf.set_default('keep_alive', False, group="wsgi") + # many tests synchronizes on the reception of versioned notifications + self.conf.set_default( + 'notification_format', "both", group="notifications") + config.parse_args([], default_config_files=[], configure_db=False, init_rpc=False) policy_opts.set_defaults(self.conf) diff --git a/releasenotes/notes/unversioned-as-default-notification_format-f149db44b319aa07.yaml b/releasenotes/notes/unversioned-as-default-notification_format-f149db44b319aa07.yaml new file mode 100644 index 000000000000..18b088fa69c2 --- /dev/null +++ b/releasenotes/notes/unversioned-as-default-notification_format-f149db44b319aa07.yaml @@ -0,0 +1,11 @@ +--- +upgrade: + - | + To resolve `bug 1805659`_ the default value of + ``[notifications]/notification_format`` is changed from ``both`` to + ``unversioned``. For more information see the `documentation of the config + option`_. If you are using versioned notifications, you will need to adjust + your config to ``versioned``" + + .. _`bug 1805659`: https://bugs.launchpad.net/nova/+bug/1805659 + .. _`documentation of the config option`: https://docs.openstack.org/nova/latest/configuration/config.html#notifications.notification_format