InstanceMapping uses invalid UUID

Bug #1742760 reported by Ed Leafe
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Ed Leafe

Bug Description

The InstanceMapping class contains the 'instance_uuid' field. When mapping instances, they can be done in batches, and in order to do this, a marker containing the UUID of the last mapped instance is created in the table. However, since the instance_uuid column has a unique constraint, the value is munged by replacing the dashes ('-') with spaces.

The oslo_versionedobjects module was recently updated to enforce the validity of all values in UUID fields. As a transition, it only emits warnings, but in the future, it will raise ValueErrors. Tests of the mapping marker behavior show the warning:

oslo_versionedobjects/fields.py:348: FutureWarning: 655662b2 6573 42f9 abbf de92533e20a8 is an invalid UUID. Using UUIDFields with invalid UUIDs is no longer supported, and will be removed in a future release. Please update your code to input valid UUIDs or accept ValueErrors for invalid UUIDs.

We need to update the InstanceMapping marker code to avoid creating invalid UUIDs.

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/539323

Changed in nova:
status: New → In Progress
Changed in nova:
assignee: Ed Leafe (ed-leafe) → Andreas Jaeger (jaegerandi)
Changed in nova:
assignee: Andreas Jaeger (jaegerandi) → Ed Leafe (ed-leafe)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit a563d1fdd318ad206755e58fa9bb5da629aef209
Author: Ed Leafe <email address hidden>
Date: Tue Jan 30 21:02:20 2018 +0000

    Make the InstanceMapping marker UUID-like

    The InstanceMapping class contains the 'instance_uuid' field. When
    mapping instances, they can be done in batches, and in order to do this,
    a marker containing the UUID of the last mapped instance is created in
    the table. However, since the instance_uuid column has a unique
    constraint, the value is munged by replacing the dashes ('-') with
    spaces.

    The oslo_versionedobjects module was recently updated to enforce the
    validity of all values in UUID fields. As a transition, it only emits
    warnings, but in the future, it will raise ValueErrors. Tests of the
    mapping marker behavior show the warning:

    oslo_versionedobjects/fields.py:348: FutureWarning: 655662b2 6573 42f9
    abbf de92533e20a8 is an invalid UUID. Using UUIDFields with invalid
    UUIDs is no longer supported, and will be removed in a future release.
    Please update your code to input valid UUIDs or accept ValueErrors for
    invalid UUIDs.

    We need to update the InstanceMapping marker code to avoid creating
    invalid UUIDs. This change accomplishes this be introducing a method
    that "shifts" the digits in the UUID to store, and unshifts them to
    recover. The stored value should have no more of a chance of a collision
    with an existing value than any other UUID added to the table.

    Closes-Bug: #1742760

    Change-Id: I5b3f7f21c0f2593a588a368c977fc71f49b9d222

Changed in nova:
status: In Progress → Fix Released
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.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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