Comment 12 for bug 1836754

Revision history for this message
melanie witt (melwitt) wrote :

The uptick of appearance of this bug in the gate seems to correlate with the timing of the merging of consumer types in placement [1].

Looking through, the only thing that seems could be causing the increase in hits is this part that groups all of the consumer database writes during _set_allocations_for_consumer into a single database transaction [2]:

[...]

    # NOTE(melwitt): Group all of the database updates in a single transaction
    # so that updates get rolled back automatically in the event of a consumer
    # generation conflict.
    _set_allocations_for_consumer_same_transaction(
        context, consumer_uuid, data, allocation_data, want_version)

    req.response.status = 204
    req.response.content_type = None
    return req.response

@db_api.placement_context_manager.writer
def _set_allocations_for_consumer_same_transaction(context, consumer_uuid,
                                                   data, allocation_data,
                                                   want_version):

[...]

Is it possible this the transaction takes just long enough to increase the chances of the race to update a consumer?

[1] https://review.opendev.org/c/openstack/placement/+/679441
[2] https://github.com/openstack/placement/commit/37721325798dda64d96d174f9e316620639fc9c9#diff-8278dbebda82d59bb97c4b864896d53161108f8238ff6ab00b63b7757e7d9043R413-R425