The host aggregate cache multiple images errors

Bug #2034702 reported by liwenjian
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Confirmed
Low
liwenjian

Bug Description

The host aggregate cache reports an error when multiple images are not sorted during deduplication

* Step-by-step reproduction steps:
Create aggregate
Create images
Aggregate cache images

[root@control1 ~]# openstack aggregate create agg1
+-------------------+--------------------------------------+
| Field | Value |
+-------------------+--------------------------------------+
| availability_zone | None |
| created_at | 2023-09-07T12:07:40.073539 |
| deleted_at | None |
| hosts | None |
| id | 6 |
| is_deleted | False |
| name | agg1 |
| properties | None |
| updated_at | None |
| uuid | 21ff4ca8-210d-416f-9736-bf2e45750e2f |
+-------------------+--------------------------------------+
[root@control1 ~]# openstack aggregate add host agg1 compute1
+-------------------+--------------------------------------+
| Field | Value |
+-------------------+--------------------------------------+
| availability_zone | None |
| created_at | 2023-09-07T12:07:40.073539 |
| deleted_at | None |
| hosts | None |
| id | 6 |
| is_deleted | False |
| name | agg1 |
| properties | None |
| updated_at | None |
| uuid | 21ff4ca8-210d-416f-9736-bf2e45750e2f |
+-------------------+--------------------------------------+
[root@control1 ~]# openstack aggregate set --property availability_zone=nova 6
[root@control1 ~]# openstack aggregate show 6
+-------------------+--------------------------------------+
| Field | Value |
+-------------------+--------------------------------------+
| availability_zone | nova |
| created_at | 2023-09-07T12:07:50.073539 |
| deleted_at | None |
| hosts | compute1 |
| id | 6 |
| is_deleted | False |
| name | Host Aggregation |
| properties | |
| updated_at | None |
| uuid | 21ff4ca8-210d-416f-9736-bf2e45750e2f |
+-------------------+--------------------------------------+

[root@control1 ~]# openstack image list
+--------------------------------------+------------------------+--------+
| ID | Name | Status |
+--------------------------------------+------------------------+--------+
| 389ffe8a-ebf3-4937-86ae-812057264a69 | CentOS 7 | active |
| cc927ebc-8c19-4533-8956-188064e778bc | amphora-x86_64-haproxy | active |
| 3f932c75-03aa-4aeb-adfc-7f6875e986aa | test | active |
+--------------------------------------+------------------------+--------+

[root@control1 ~]# openstack aggregate cache image 6 389ffe8a-ebf3-4937-86ae-812057264a69 cc927ebc-8c19-4533-8956-188064e778bc 3f932c75-03aa-4aeb-adfc-7f6875e986aa
BadRequestException: 400: Client Error for url: http://10.0.5.30:8774/v2.1/os-aggregates/6/images, Duplicate images in request

Even though images have no duplicate id, the list order of images has changed after deduplication, and the judgment condition is wrong during comparison.
https://github.com/openstack/nova/blob/master/nova/api/openstack/compute/aggregates.py#L292

liwenjian (liwenjian)
Changed in nova:
assignee: nobody → liwenjian (liwenjian)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (master)

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

Changed in nova:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to nova (master)

Reviewed: https://review.opendev.org/c/openstack/nova/+/894288
Committed: https://opendev.org/openstack/nova/commit/aa500fbb31d2f7129c048460e57a3dff229cabc8
Submitter: "Zuul (22348)"
Branch: master

commit aa500fbb31d2f7129c048460e57a3dff229cabc8
Author: liwenjian <email address hidden>
Date: Fri Sep 8 17:14:38 2023 +0800

    Fixed an error when caching multiple images in aggregate

    Because in the process of judging whether the image id is Duplicate,there is only deduplication without sorting, so no duplicate image error is judged as duplicate and an error "Duplicate images in request" is reported.

    Now it is changed to sort after deduplication and then compare.

    Two unit test cases were added to verify the fix

    Related-Bug: #2034702
    Change-Id: I300a3e29ba56584f4c99d534a6cf8ee7dc0ed4b7

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

Related fix proposed to branch: stable/2023.2
Review: https://review.opendev.org/c/openstack/nova/+/904017

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

Related fix proposed to branch: stable/2023.1
Review: https://review.opendev.org/c/openstack/nova/+/904018

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

Related fix proposed to branch: stable/zed
Review: https://review.opendev.org/c/openstack/nova/+/904019

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

Related fix proposed to branch: stable/yoga
Review: https://review.opendev.org/c/openstack/nova/+/904020

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

Related fix proposed to branch: stable/xena
Review: https://review.opendev.org/c/openstack/nova/+/904081

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

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

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

Related fix proposed to branch: stable/victoria
Review: https://review.opendev.org/c/openstack/nova/+/904083

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

Related fix proposed to branch: stable/ussuri
Review: https://review.opendev.org/c/openstack/nova/+/904084

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

Change abandoned by "Elod Illes <email address hidden>" on branch: stable/yoga
Review: https://review.opendev.org/c/openstack/nova/+/904020
Reason: stable/yoga branch of openstack/nova is about to be deleted. To be able to do that, all open patches need to be abandoned. Please cherry pick the patch to unmaintained/yoga if you want to further work on this patch.

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

Change abandoned by "Elod Illes <email address hidden>" on branch: stable/ussuri
Review: https://review.opendev.org/c/openstack/nova/+/904084
Reason: stable/ussuri branch of openstack/nova transitioned to End of Life and is about to be deleted. To be able to do that, all open patches need to be abandoned.

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

Change abandoned by "Elod Illes <email address hidden>" on branch: stable/victoria
Review: https://review.opendev.org/c/openstack/nova/+/904083
Reason: stable/victoria branch of openstack/nova is about to be deleted. To be able to do that, all open patches need to be abandoned. Please cherry pick the patch to unmaintained/victoria if you want to further work on this patch.

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

Change abandoned by "Elod Illes <email address hidden>" on branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/nova/+/904082
Reason: stable/wallaby branch of openstack/nova is about to be deleted. To be able to do that, all open patches need to be abandoned. Please cherry pick the patch to unmaintained/wallaby if you want to further work on this patch.

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

Change abandoned by "Elod Illes <email address hidden>" on branch: stable/xena
Review: https://review.opendev.org/c/openstack/nova/+/904081
Reason: stable/xena branch of openstack/nova is about to be deleted. To be able to do that, all open patches need to be abandoned. Please cherry pick the patch to unmaintained/xena if you want to further work on this patch.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (unmaintained/xena)

Related fix proposed to branch: unmaintained/xena
Review: https://review.opendev.org/c/openstack/nova/+/911071

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

Related fix proposed to branch: unmaintained/wallaby
Review: https://review.opendev.org/c/openstack/nova/+/911072

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (unmaintained/victoria)

Related fix proposed to branch: unmaintained/victoria
Review: https://review.opendev.org/c/openstack/nova/+/911073

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

Change abandoned by "Elod Illes <email address hidden>" on branch: stable/zed
Review: https://review.opendev.org/c/openstack/nova/+/904019
Reason: stable/zed branch of openstack/nova is about to be deleted. To be able to do that, all open patches need to be abandoned. Please cherry pick the patch to unmaintained/zed if you want to further work on this patch.

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.