archive_deleted_rows --until-complete stops if api database is not configured

Bug #1753833 reported by Matt Riedemann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Surya Seetharaman
Queens
Fix Committed
Medium
Surya Seetharaman

Bug Description

This change https://review.openstack.org/#/c/515034/ (added in queens) makes the archive_deleted_rows CLI remove instance mappings and request specs from the API database if there are instances archived from the main nova/cell database.

However, with 'superconductor' mode configurations where the cell shouldn't be configured to reach the API database, this will fail, as seen here:

http://logs.openstack.org/71/550171/4/check/nova-next/4986796/logs/devstack-gate-post_test_hook.txt.gz#_2018-03-06_20_44_21_017

So in the case that the API database isn't configured in the nova.conf being used to run the CLI, we should gracefully handle the condition and continue archiving.

I think we could either do this by handling the CantStartEngineError from oslo.db or just check to see if CONF.api_database.connection is set before attempting to hit records in the API DB.

Tags: db nova-manage
Matt Riedemann (mriedem)
Changed in nova:
status: New → Triaged
importance: Undecided → Medium
Changed in nova:
assignee: nobody → Surya Seetharaman (tssurya)
Revision history for this message
Surya Seetharaman (tssurya) wrote :

Adapted Solution : Using the CantStartEngineError for handling this gracefully, continuing the archival and informing the user that 0 instance_mappings and 0 request_specs rows were archived because the CONF.api_database.connection was not set.

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

Fix proposed to branch: master
Review: https://review.openstack.org/550967

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

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/553742

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

Reviewed: https://review.openstack.org/550967
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=8da6831e6375d013f0235a542b6b91580a43f61f
Submitter: Zuul
Branch: master

commit 8da6831e6375d013f0235a542b6b91580a43f61f
Author: Surya Seetharaman <email address hidden>
Date: Thu Mar 8 19:06:00 2018 +0100

    Make archive_deleted_rows handle a missing CONF.api_database.connection

    This change https://review.openstack.org/#/c/515034/ (added in queens)
    makes the archive_deleted_rows CLI remove instance mappings and request
    specs from the API database if there are instances archived from the
    main nova/cell database. However for this to work, the api database
    connection should be set in the config file. So in the case that the
    API database is not configured in the config file being used to run the
    CLI, we should gracefully handle the condition and and stop archiving thus
    prompting the user to set the api_db config and try the archival operation
    again. This patch fixes the graceful handling.

    Change-Id: I0c7b802a453aa423c7273ab724ce78eac0cfed4c
    Closes-Bug: #1753833

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

Reviewed: https://review.openstack.org/553742
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=aaae38d1aa227a732b9aa8c93d77a909d0324696
Submitter: Zuul
Branch: stable/queens

commit aaae38d1aa227a732b9aa8c93d77a909d0324696
Author: Surya Seetharaman <email address hidden>
Date: Thu Mar 8 19:06:00 2018 +0100

    Make archive_deleted_rows handle a missing CONF.api_database.connection

    This change https://review.openstack.org/#/c/515034/ (added in queens)
    makes the archive_deleted_rows CLI remove instance mappings and request
    specs from the API database if there are instances archived from the
    main nova/cell database. However for this to work, the api database
    connection should be set in the config file. So in the case that the
    API database is not configured in the config file being used to run the
    CLI, we should gracefully handle the condition and and stop archiving thus
    prompting the user to set the api_db config and try the archival operation
    again. This patch fixes the graceful handling.

    Conflicts:
        nova/tests/unit/test_nova_manage.py

    NOTE(tssurya): The conflict is due to not having changes
    I6f87cf03d49be6bfad2c5e6f0c8accf0fab4e6ee and
    Ibd824a77b32cbceb60973a89a93ce09fe6d1050d in Queens.

    Change-Id: I0c7b802a453aa423c7273ab724ce78eac0cfed4c
    Closes-Bug: #1753833
    (cherry picked from commit 8da6831e6375d013f0235a542b6b91580a43f61f)

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

This issue was fixed in the openstack/nova 17.0.2 release.

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

This issue was fixed in the openstack/nova 18.0.0.0b1 development milestone.

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.