Comment 2 for bug 1742760

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