[OVN] ovn_hash_ring table cleanup

Bug #2033281 reported by Max
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Lucas Alvares Gomes

Bug Description

The ovn hash ring implementation is currently based on the hostname.
Does it make sense to implement a periodic cleanup job? E.g. clean offline nodes which are older than 7 days or so.

In our environment, the ovn_hash_ring table grows a lot because our API runs containerized with random hostnames (e.g. neutron-api-5fc8ffb45-dl86p). This means with every api restart we have 64 new entries due to 64 api_workers.

MariaDB [neutron]> select count(*) from ovn_hash_ring;
+----------+
| count(*) |
+----------+
| 80957 |
+----------+
1 row in set (0.003 sec)

Revision history for this message
Rodolfo Alonso (rodolfo-alonso-hernandez) wrote :

Hello Max:

What version of Neutron API are you using?

Since [1], the Neutron API deletes the "ovn_hash_ring" associated register when the Neutron API is stopped [2]. Please check that you have this in your code. If you have this patch in your code, please check that you stop the container gracefully, allowing the signal.signal(signal.SIGTERM) method to remove the DB register.

The same method is also removing the associated nodes during the transient start period. But according to your report, you are using different random hostnames (that initially was not considered).

Lucas is also going to propose a maintenance task to perform a periodic clean-up, considering the case you are proposing.

Regards.

[1]https://review.opendev.org/q/I4b7376cf7df45fcc6e487970b068d06b4e74e319
[2]https://review.opendev.org/c/openstack/neutron/+/886279/2/neutron/plugins/ml2/drivers/ovn/mech_driver/mech_driver.py#299

Changed in neutron:
assignee: nobody → Lucas Alvares Gomes (lucasagomes)
importance: Undecided → Medium
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/+/893030

Changed in neutron:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/2023.1)

Fix proposed to branch: stable/2023.1
Review: https://review.opendev.org/c/openstack/neutron/+/893140

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

Fix proposed to branch: stable/zed
Review: https://review.opendev.org/c/openstack/neutron/+/893141

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

Fix proposed to branch: stable/yoga
Review: https://review.opendev.org/c/openstack/neutron/+/893142

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

Fix proposed to branch: stable/xena
Review: https://review.opendev.org/c/openstack/neutron/+/893143

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

Fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/neutron/+/893144

tags: added: ovn
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

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

commit 7f777c223e557f7bb0e0290090019eaa60095b50
Author: Lucas Alvares Gomes <email address hidden>
Date: Tue Aug 29 11:37:52 2023 +0100

    [OVN] Cleanup old Hash Ring node entries

    This patch introduces a maintenance task that runs once a day and is
    responsible for cleaning up Hash Ring nodes that haven't been updated in
    5 days or more.

    Change-Id: Ibed9e0d77500570c3d0f9f39bfe40cb9239d0d7a
    Closes-Bug: #2033281
    Signed-off-by: Lucas Alvares Gomes <email address hidden>

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

Reviewed: https://review.opendev.org/c/openstack/neutron/+/893140
Committed: https://opendev.org/openstack/neutron/commit/adfe0659c619ad82761c9622bdcfdffed09248da
Submitter: "Zuul (22348)"
Branch: stable/2023.1

commit adfe0659c619ad82761c9622bdcfdffed09248da
Author: Lucas Alvares Gomes <email address hidden>
Date: Tue Aug 29 11:37:52 2023 +0100

    [OVN] Cleanup old Hash Ring node entries

    This patch introduces a maintenance task that runs once a day and is
    responsible for cleaning up Hash Ring nodes that haven't been updated in
    5 days or more.

    Change-Id: Ibed9e0d77500570c3d0f9f39bfe40cb9239d0d7a
    Closes-Bug: #2033281
    Signed-off-by: Lucas Alvares Gomes <email address hidden>
    (cherry picked from commit 7f777c223e557f7bb0e0290090019eaa60095b50)

tags: added: in-stable-zed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/zed)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/893141
Committed: https://opendev.org/openstack/neutron/commit/850da2af847742e483c70c1cb36b11154e5e141a
Submitter: "Zuul (22348)"
Branch: stable/zed

commit 850da2af847742e483c70c1cb36b11154e5e141a
Author: Lucas Alvares Gomes <email address hidden>
Date: Tue Aug 29 11:37:52 2023 +0100

    [OVN] Cleanup old Hash Ring node entries

    This patch introduces a maintenance task that runs once a day and is
    responsible for cleaning up Hash Ring nodes that haven't been updated in
    5 days or more.

    Change-Id: Ibed9e0d77500570c3d0f9f39bfe40cb9239d0d7a
    Closes-Bug: #2033281
    Signed-off-by: Lucas Alvares Gomes <email address hidden>
    (cherry picked from commit 7f777c223e557f7bb0e0290090019eaa60095b50)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/yoga)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/893142
Committed: https://opendev.org/openstack/neutron/commit/79010935c0441598c2ce6d82f59d1fb828f3437e
Submitter: "Zuul (22348)"
Branch: stable/yoga

commit 79010935c0441598c2ce6d82f59d1fb828f3437e
Author: Lucas Alvares Gomes <email address hidden>
Date: Tue Aug 29 11:37:52 2023 +0100

    [OVN] Cleanup old Hash Ring node entries

    This patch introduces a maintenance task that runs once a day and is
    responsible for cleaning up Hash Ring nodes that haven't been updated in
    5 days or more.

    Change-Id: Ibed9e0d77500570c3d0f9f39bfe40cb9239d0d7a
    Closes-Bug: #2033281
    Signed-off-by: Lucas Alvares Gomes <email address hidden>
    (cherry picked from commit 7f777c223e557f7bb0e0290090019eaa60095b50)

tags: added: in-stable-yoga
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/wallaby)

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

commit ba6c2eeeb7c6573ff5d33b459e89adaccccfa8ac
Author: Lucas Alvares Gomes <email address hidden>
Date: Tue Aug 29 11:37:52 2023 +0100

    [OVN] Cleanup old Hash Ring node entries

    This patch introduces a maintenance task that runs once a day and is
    responsible for cleaning up Hash Ring nodes that haven't been updated in
    5 days or more.

    Change-Id: Ibed9e0d77500570c3d0f9f39bfe40cb9239d0d7a
    Closes-Bug: #2033281
    Signed-off-by: Lucas Alvares Gomes <email address hidden>
    (cherry picked from commit 7f777c223e557f7bb0e0290090019eaa60095b50)

tags: added: in-stable-wallaby
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/xena)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/893143
Committed: https://opendev.org/openstack/neutron/commit/98a1476ed88027ea6b88515163428fae9663c776
Submitter: "Zuul (22348)"
Branch: stable/xena

commit 98a1476ed88027ea6b88515163428fae9663c776
Author: Lucas Alvares Gomes <email address hidden>
Date: Tue Aug 29 11:37:52 2023 +0100

    [OVN] Cleanup old Hash Ring node entries

    This patch introduces a maintenance task that runs once a day and is
    responsible for cleaning up Hash Ring nodes that haven't been updated in
    5 days or more.

    Change-Id: Ibed9e0d77500570c3d0f9f39bfe40cb9239d0d7a
    Closes-Bug: #2033281
    Signed-off-by: Lucas Alvares Gomes <email address hidden>
    (cherry picked from commit 7f777c223e557f7bb0e0290090019eaa60095b50)

tags: added: in-stable-xena
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 23.0.0.0rc1

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

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 20.5.0

This issue was fixed in the openstack/neutron 20.5.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.

Other bug subscribers

Remote bug watches

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