From f223c443b5b64f4385f128fa3b93cac25ea3e1f5 Mon Sep 17 00:00:00 2001 From: Matt Riedemann Date: Thu, 24 Jan 2019 17:11:06 -0500 Subject: [PATCH] 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 (cherry picked from commit 74f9bba9c7ac27df8f73d11fc317649ae22040fb) (cherry picked from commit 99b3f44eb138b02bd5e967cbbb1574ebcdbc6cc5) (cherry picked from commit 1f83d773a436c41709b5d6b30a51c979bb935fa2) --- nova/db/sqlalchemy/api.py | 1 + 1 file changed, 1 insertion(+) diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py index eaaa9cc1816f..ac577b873eeb 100644 --- a/nova/db/sqlalchemy/api.py +++ b/nova/db/sqlalchemy/api.py @@ -4280,6 +4280,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)