[OVN] "_load_hash_ring" is couting the hash righ nodes without opening a DB txn

Bug #2024447 reported by Rodolfo Alonso
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Rodolfo Alonso

Bug Description

In [1], we are accessing to the DB calling "count_offline_nodes". This call is issuing a DB request without opening a txn (reader context, for example).

The methods "get_active_nodes" and "count_offline_nodes" are calling query.all() and query.count() outside the reader context that is created in "_get_nodes_query".

[1]https://review.opendev.org/c/openstack/neutron/+/886005/2/neutron/common/ovn/hash_ring_manager.py

description: updated
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/+/886457

Changed in neutron:
status: New → In Progress
Changed in neutron:
assignee: nobody → Rodolfo Alonso (rodolfo-alonso-hernandez)
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

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

commit 0c66dfaed8e1ec00726c3e484e69174779678abd
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Tue Jun 20 10:22:14 2023 +0000

    [OVN] The all() and count() methods should be inside a DB txn

    The ``ovn_hash_ring_db`` methods ``get_active_nodes`` and
    ``count_offline_nodes`` are sending SQL requests that should be issued
    from inside a READER context.

    Closes-Bug: #2024447
    Change-Id: If06c372a9d5cb1dc1ec1af768abb61f52c2c5abd

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 20.4.0

This issue was fixed in the openstack/neutron 20.4.0 release.

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

This issue was fixed in the openstack/neutron 23.0.0.0b3 development milestone.

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

This issue was fixed in the openstack/neutron 22.1.0 release.

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

This issue was fixed in the openstack/neutron 21.2.0 release.

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

This issue was fixed in the openstack/neutron wallaby-eom release.

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

This issue was fixed in the openstack/neutron xena-eom release.

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.