Comment 11 for bug 1839560

Submitter: Zuul
Branch: stable/stein

commit e7109d43d6d6db0f9db18976585f3334d2be72bf
Author: Matt Riedemann <email address hidden>
Date: Fri Aug 9 17:24:07 2019 -0400

    Add functional regression recreate test for bug 1839560

    This adds a functional test which recreates bug 1839560
    where the driver reports a node, then no longer reports
    it so the compute manager deletes it, and then the driver
    reports it again later (this can be common with ironic
    nodes as they undergo maintenance). The issue is that since
    Ia69fabce8e7fd7de101e291fe133c6f5f5f7056a in Rocky, the
    ironic node uuid is re-used for the compute node uuid but
    there is a unique constraint on the compute node uuid so
    when trying to create the compute node once the ironic node
    is available again, the compute node create fails with a
    duplicate entry error due to the duplicate uuid. To recreate
    this in the functional test, a new fake virt driver is added
    which provides a predictable uuid per node like the ironic
    driver. The test also shows that archiving the database is
    a way to workaround the bug until it's properly fixed.

    NOTE(mriedem): Since change I2cf2fcbaebc706f897ce5dfbff47d32117064f9c
    is not in Stein this backport needs to modify the test to use
    the global set_nodes/restore_nodes which means we can remove some
    of the startup hackery at the beginning of the test. Also, since
    FakeDriver.set_nodes does not exist in Stein we have to modify the
    FakeDriver._nodes variable directly (the global doesn't affect that
    after startup).

    Change-Id: If822509e906d5094f13a8700b2b9ed3c40580431
    Related-Bug: #1839560
    (cherry picked from commit 89dd74ac7f1028daadf86cb18948e27fe9d1d411)