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)
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_allocation s_for_consumer into a single database transaction [2]:
[...]
# NOTE(melwitt): Group all of the database updates in a single transaction allocations_ for_consumer_ same_transactio n(
# so that updates get rolled back automatically in the event of a consumer
# generation conflict.
_set_
context, consumer_uuid, data, allocation_data, want_version)
req. response. status = 204 response. content_ type = None
req.
return req.response
@db_api. placement_ context_ manager. writer s_for_consumer_ same_transactio n(context, consumer_uuid,
data, allocation_data,
want_ version) :
def _set_allocation
[...]
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 /github. com/openstack/ placement/ commit/ 37721325798dda6 4d96d174f9e3166 20639fc9c9# diff-8278dbebda 82d59bb97c4b864 896d53161108f82 38ff6ab00b63b77 57e7d9043R413- R425
[2] https:/