API extensions not supported by e.g. OVN driver may still be on the list returned from neutron

Bug #1929676 reported by Slawek Kaplonski
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Slawek Kaplonski

Bug Description

Some time ago we introduced possibility for mechanism drivers to explicitly filter and filter API extensions which they don't supports so such extensions aren't really listed in the API.

But the problem is that when there are more than one mech drivers enabled, first of them will filter some extensions, but other don't filters anything, not supported extensions may appears on the list.

To reproduce the issue let's enable ovn and logging mech_drivers:

mechanism_drivers = ovn,logger

And then check e.g. dhcp_agent_scheduler that it will be on the list returned by cmd "neutron ext-list", even if it's not supported by ovn.

The problem is that _filter_extensions_by_mech_driver is passing list of all ML2 extensions to each mech_driver so even if one of them disable it, other can add it back to the list: https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/plugin.py#L318

Maybe better approach would be to have on the list only extensions which are supported by all enabled mech_drivers?

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/neutron/+/793141

Changed in neutron:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to neutron (master)

Related fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/neutron/+/793360

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Related fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/neutron/+/793361

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Related fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/neutron/+/795979

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to neutron (master)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/793360
Committed: https://opendev.org/openstack/neutron/commit/7d8a5eb5a76ce5df8688db8b792a6dd4d839d677
Submitter: "Zuul (22348)"
Branch: master

commit 7d8a5eb5a76ce5df8688db8b792a6dd4d839d677
Author: Slawek Kaplonski <email address hidden>
Date: Thu May 27 11:31:17 2021 +0200

    [OVN] Add availability zone to the ML2_SUPPORTED_API_EXTENSIONS list

    Currently in the ML2_SUPPORTED_API_EXTENSIONS which is list of
    extensions supported by OVN mech driver there was
    network_availability_zone extension. But that extension requires
    availability_zone extension which was added only in
    ML2_SUPPORTED_API_EXTENSIONS_OVN_L3 which is list of extensions
    supported by the OVN L3 plugin.
    To fix that, this patch adds availability_zone extension to the
    ML2_SUPPORTED_API_EXTENSIONS list also.

    Related-Bug: #1929676
    Change-Id: If815cff18f83962233f3d6a535b18070690ce948

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.opendev.org/c/openstack/neutron/+/793361
Committed: https://opendev.org/openstack/neutron/commit/6fb2f513da3e7f5b258726f187f14fbfec71c427
Submitter: "Zuul (22348)"
Branch: master

commit 6fb2f513da3e7f5b258726f187f14fbfec71c427
Author: Slawek Kaplonski <email address hidden>
Date: Thu May 27 11:54:08 2021 +0200

    [OVN] Add 'port-mac-address-regenerate' to the supported extensions

    In fact this API extension is independent of the mech driver and should
    be listed as supported by the OVN mech driver to not be filtered out
    from the list of actually available extensions.

    Related-Bug: #1929676
    Change-Id: Ie2d5c52ce09b1b366717830f0af53f26366ee4b8

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.opendev.org/c/openstack/neutron/+/795979
Committed: https://opendev.org/openstack/neutron/commit/bc82a664b637c72b49fd585a41350164103d6aaa
Submitter: "Zuul (22348)"
Branch: master

commit bc82a664b637c72b49fd585a41350164103d6aaa
Author: Slawek Kaplonski <email address hidden>
Date: Fri Jun 11 12:12:07 2021 +0200

    Move dns-integration extension to the ML2_SUPPORTED_API_EXTENSIONS list

    dns-integration extension is actually implemented as ML2 extension
    driver, so has nothing to do with the L3 plugin.
    In OVN it was listed in the ML2_SUPPORTED_API_EXTENSIONS_OVN_L3 but it
    should be in ML2_SUPPORTED_API_EXTENSIONS. This patch moves it to the
    correct list.
    This patch also removes disable_dns_extension_by_extension_drivers
    method from the OVN L3 plugin class as there is no need to disable this
    extension by L3 agent.

    Related-Bug: #1929676
    Change-Id: I456afcc9054627e74b18460d169052f262451c22

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/793141
Committed: https://opendev.org/openstack/neutron/commit/db2207f32d2b88772966e4e2a4f10e2ad66fcf49
Submitter: "Zuul (22348)"
Branch: master

commit db2207f32d2b88772966e4e2a4f10e2ad66fcf49
Author: Slawek Kaplonski <email address hidden>
Date: Wed May 26 12:52:39 2021 +0200

    [ML2] Change way how list of supported API extensions is made

    Previously if extension was not supported by one of the mech drivers,
    but it wasn't filtered out by next mech driver, it was available finally
    in the list.
    Now, this patch changes that so if extension is disabled by one of the
    drivers it isn't available on the list at all.
    This will work better e.g. with discoverability of what is available
    e.g. when OVN backend is used by Neutron.

    Closes-Bug: #1929676
    Change-Id: I6a4ff42f47f7ee90365516d37472c09ac87773e5

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 19.0.0.0rc1

This issue was fixed in the openstack/neutron 19.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to neutron (stable/wallaby)

Related fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/neutron/+/812509

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Related fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/neutron/+/815306

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (stable/wallaby)

Change abandoned by "Alex Kavanagh <email address hidden>" on branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/neutron/+/812509
Reason: Abandoned; changed change-id to I456afcc9054627e74b18460d169052f262451c22 at request of Rodolfo Alonso. see https://review.opendev.org/c/openstack/neutron/+/815306

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to neutron (stable/wallaby)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/815306
Committed: https://opendev.org/openstack/neutron/commit/dbde4d99794eeb47a2792dda798c96062cd2e368
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit dbde4d99794eeb47a2792dda798c96062cd2e368
Author: Slawek Kaplonski <email address hidden>
Date: Fri Jun 11 12:12:07 2021 +0200

    Move dns-integration extension to the ML2_SUPPORTED_API_EXTENSIONS list

    Cherry-picked from bc82a66 (I456afcc9054627e74b18460d169052f262451c22)

    dns-integration extension is actually implemented as ML2 extension
    driver, so has nothing to do with the L3 plugin.
    In OVN it was listed in the ML2_SUPPORTED_API_EXTENSIONS_OVN_L3 but it
    should be in ML2_SUPPORTED_API_EXTENSIONS. This patch moves it to the
    correct list.
    This patch also removes disable_dns_extension_by_extension_drivers
    method from the OVN L3 plugin class as there is no need to disable this
    extension by L3 agent.

    Related-Bug: #1929676
    Change-Id: I456afcc9054627e74b18460d169052f262451c22
    (cherry picked from commit bc82a664b637c72b49fd585a41350164103d6aaa)

tags: added: in-stable-wallaby
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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