Add retry_on_deadlock to migration_update DB API

Lots of different things can be updating the same migration
record at the same time (different computes, the API, etc)
and we see DBDeadlock errors on migration_update at times
(and operators that do a lot of migrations have mentioned it
also) so this change simply adds the retry_on_deadlock decorator
to the migration_update DB API method.

Change-Id: I98bbe96e4be5326e18ef2c2ac50c0d24993d52ec
Closes-Bug: #1642537
This commit is contained in:
Matt Riedemann 2019-01-24 17:11:06 -05:00
parent 9fa26e439b
commit 74f9bba9c7
1 changed files with 1 additions and 0 deletions

View File

@ -4274,6 +4274,7 @@ def migration_create(context, values):
return migration
@oslo_db_api.wrap_db_retry(max_retries=5, retry_on_deadlock=True)
@pick_context_manager_writer
def migration_update(context, id, values):
migration = migration_get(context, id)