[PostgreSQL] Issue with "get_scoped_floating_ips" query

Bug #2019186 reported by Rodolfo Alonso
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Rodolfo Alonso

Bug Description

As reported in the Ironic CI [1], the query performed in ``FloatingIP.get_scoped_floating_ips`` is failing because of:
"""
ERROR oslo_messaging.rpc.server oslo_db.exception.DBError: (psycopg2.errors.GroupingError) column "subnetpools.address_scope_id" must appear in the GROUP BY clause or be used in an aggregate function
May 03 18:42:03.790127 np0033933847 neutron-server[90676]: ERROR oslo_messaging.rpc.server LINE 2: ...standard_attr_id AS floatingips_standard_attr_id, subnetpool...
"""

The patch that introduced the "GROUP BY" clause is [2].

Snippet: https://paste.opendev.org/show/bPxCQXpieE5G5v31xudJ/

[1]https://storage.bhs.cloud.ovh.net/v1/AUTH_dcaab5e32b234d56b626f72581e3644c/zuul_opendev_logs_291/882164/1/check/ironic-tempest-pxe_ipmitool-postgres/291f2f8/controller/logs/screen-q-svc.txt
[2]https://review.opendev.org/c/openstack/neutron/+/876168

Changed in neutron:
assignee: nobody → Rodolfo Alonso (rodolfo-alonso-hernandez)
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/+/882935

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

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

commit 3b7699bc6614d0c03d55087e63c4ccd19878caa4
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Wed May 10 06:32:32 2023 +0200

    Add scope ID to the "GROUP BY" clause in ``get_scoped_floating_ips``

    PostgreSQL requires to add the table keys selected in the SELECT clause
    in the later GROUP BY clause. This patch is adding
    "SubnetPool.address_scope_id" to this GROUP BY clause. Because the
    subnet pool (for IPv4) is unique for the FIP subnet, the returned
    elements in this query will be the same.

    Closes-Bug: #2019186
    Change-Id: Ia446e17a44b1a260971ae237841451edb97ce39f

Changed in neutron:
status: In Progress → Fix Released
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/+/892599

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 merged to neutron (stable/2023.1)

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

commit 37bdb9e7d5e719096ab6a5980c4a6da4c2f5dbbc
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Wed May 10 06:32:32 2023 +0200

    Add scope ID to the "GROUP BY" clause in ``get_scoped_floating_ips``

    PostgreSQL requires to add the table keys selected in the SELECT clause
    in the later GROUP BY clause. This patch is adding
    "SubnetPool.address_scope_id" to this GROUP BY clause. Because the
    subnet pool (for IPv4) is unique for the FIP subnet, the returned
    elements in this query will be the same.

    Conflicts:
        neutron/objects/router.py
        neutron/tests/unit/objects/test_router.py

    Closes-Bug: #2019186
    Change-Id: Ia446e17a44b1a260971ae237841451edb97ce39f
    (cherry picked from commit 3b7699bc6614d0c03d55087e63c4ccd19878caa4)

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.