ComputeTaskManager._cold_migrate could get a legacy request spec dict from stein computes if rpc pinned and not convert it properly

Bug #1843090 reported by Matt Riedemann
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Matt Riedemann
Stein
Fix Committed
High
Matt Riedemann

Bug Description

As of this change in Stein https://review.opendev.org/#/c/582417/ the compute service will pass a request spec back to conductor when rescheduling during a resize or cold migration. If the compute RPC API version is pinned below 5.1, however, that request spec will be a legacy dict rather than a full RequestSpec object so the code here:

https://github.com/openstack/nova/blob/19.0.0/nova/conductor/manager.py#L302-L321

Needs to account for the legacy dict case.

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

Fix proposed to branch: master
Review: https://review.opendev.org/680762

Changed in nova:
status: Triaged → In Progress
Matt Riedemann (mriedem)
Changed in nova:
importance: Low → Medium
tags: added: resize
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/683385

Changed in nova:
assignee: Matt Riedemann (mriedem) → Balazs Gibizer (balazs-gibizer)
Matt Riedemann (mriedem)
Changed in nova:
assignee: Balazs Gibizer (balazs-gibizer) → nobody
assignee: nobody → Matt Riedemann (mriedem)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to nova (master)

Reviewed: https://review.opendev.org/683385
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=40a0f7742c8aa309772e074d67a9ea6c8a7514de
Submitter: Zuul
Branch: master

commit 40a0f7742c8aa309772e074d67a9ea6c8a7514de
Author: Balazs Gibizer <email address hidden>
Date: Fri Sep 20 13:47:29 2019 +0200

    Func test for migrate reschedule with pinned compute rpc

    This patch adds a functional test that reproduce bug 1843090.

    Related-Bug: #1843090

    Change-Id: I3c03da5bc29eed71ad35b0d5f4b922b1f56d67a7

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

Related fix proposed to branch: stable/stein
Review: https://review.opendev.org/684406

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

Fix proposed to branch: stable/stein
Review: https://review.opendev.org/684407

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

Reviewed: https://review.opendev.org/680762
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=b36c44c449533edfbcfd970ccef9d794ac3b4171
Submitter: Zuul
Branch: master

commit b36c44c449533edfbcfd970ccef9d794ac3b4171
Author: Matt Riedemann <email address hidden>
Date: Fri Sep 6 15:13:00 2019 -0400

    Handle legacy request spec dict in ComputeTaskManager._cold_migrate

    Prior to change I4244f7dd8fe74565180f73684678027067b4506e in Stein,
    conductor would pass a legacy dict request spec to compute during
    cold migrate / resize and if compute rescheduled it would not pass
    the request spec back to conductor, so the _cold_migrate method in
    conductor would have to create a new RequestSpec from components
    it had available.

    As of that change, compute will send the request spec it got back
    to conductor and _cold_migrate avoids the RequestSpec.from_components
    call.

    There are two issues here:

    1. Technically if conductor RPC API is pinned to less than 1.13 the
       ComputeTaskAPI.migrate_server method will remove the request spec
       from the call to conductor. So conductor (server-side) can still
       not get a RequestSpec and need to use from_components. As a result
       the TODO in the _cold_migrate method needs to be updated since we
       require an RPC API major version bump to make request spec required.

    2. Just because conductor is passing compute a RequestSpec object, if
       compute RPC API versions are pinned to less than 5.1, conductor will
       pass a legacy request spec dict to compute and compute will send that
       back to conductor, so the _cold_migrate method needs to handle getting
       a request spec that is a dict and convert it to an object. A new test
       is added for that case.

    Change-Id: I188b7aa9cb220f93e69a68f0c3592b28d41ba5b6
    Closes-Bug: #1843090

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

This issue was fixed in the openstack/nova 20.0.0.0rc1 release candidate.

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

Reviewed: https://review.opendev.org/684406
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=fd491c7415b0bbe4d7bfd0796548360c5d084d70
Submitter: Zuul
Branch: stable/stein

commit fd491c7415b0bbe4d7bfd0796548360c5d084d70
Author: Balazs Gibizer <email address hidden>
Date: Fri Sep 20 13:47:29 2019 +0200

    Func test for migrate reschedule with pinned compute rpc

    This patch adds a functional test that reproduce bug 1843090.

    Related-Bug: #1843090

    Change-Id: I3c03da5bc29eed71ad35b0d5f4b922b1f56d67a7
    (cherry picked from commit 40a0f7742c8aa309772e074d67a9ea6c8a7514de)

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

Reviewed: https://review.opendev.org/684407
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=66bf82864deaabf1c3eff7237bcde6dc961dea09
Submitter: Zuul
Branch: stable/stein

commit 66bf82864deaabf1c3eff7237bcde6dc961dea09
Author: Matt Riedemann <email address hidden>
Date: Fri Sep 6 15:13:00 2019 -0400

    Handle legacy request spec dict in ComputeTaskManager._cold_migrate

    Prior to change I4244f7dd8fe74565180f73684678027067b4506e in Stein,
    conductor would pass a legacy dict request spec to compute during
    cold migrate / resize and if compute rescheduled it would not pass
    the request spec back to conductor, so the _cold_migrate method in
    conductor would have to create a new RequestSpec from components
    it had available.

    As of that change, compute will send the request spec it got back
    to conductor and _cold_migrate avoids the RequestSpec.from_components
    call.

    There are two issues here:

    1. Technically if conductor RPC API is pinned to less than 1.13 the
       ComputeTaskAPI.migrate_server method will remove the request spec
       from the call to conductor. So conductor (server-side) can still
       not get a RequestSpec and need to use from_components. As a result
       the TODO in the _cold_migrate method needs to be updated since we
       require an RPC API major version bump to make request spec required.

    2. Just because conductor is passing compute a RequestSpec object, if
       compute RPC API versions are pinned to less than 5.1, conductor will
       pass a legacy request spec dict to compute and compute will send that
       back to conductor, so the _cold_migrate method needs to handle getting
       a request spec that is a dict and convert it to an object. A new test
       is added for that case.

    Conflicts:
          nova/compute/rpcapi.py

    NOTE(mriedem): The conflict is due to not having change
    Ib4e0b9ab050a59ab5a290e6eecea01b87c3bd4c6 in Stein.

    NOTE(mriedem): The unit test in test_conductor.py had to be changed
    slightly since change If1e461da382f707be2b5ba89f74f77269f0909dd is
    not in Stein.

    Change-Id: I188b7aa9cb220f93e69a68f0c3592b28d41ba5b6
    Closes-Bug: #1843090
    (cherry picked from commit b36c44c449533edfbcfd970ccef9d794ac3b4171)

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

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