summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArjun Baindur <xagent@gmail.com>2018-07-31 14:36:32 -0700
committerTomasz Setkowski <tom@ai-traders.com>2018-09-23 10:52:54 +0000
commit7c2a3be3e42cc72b6b03c9b6cb67393d423e5e21 (patch)
tree323fc9dcd7b678bc47c7e89b60e9292a4c76f6e1
parentc0b20375b6be7a6a572f59eb2913a04d917c51b5 (diff)
Make update_status use synchronized_zone
There is a race condition when adding a new recordset to a zone and when central is processing the update_status from a previous recordset/zone operation. In the subsequent recordset operation, central fails to update the zone's action/status in DB to UPDATE/PENDING. It remains as NONE/ACTIVE, and worker error's out. Each operation retrieves a different copy in memory of the Zone object (when it calls self.storage.get_zone). As a result this does not update the obj_changes field for the zone object for the latter operation. Therefore the DB update doesn't update any values. update_status should be synchronized as it updates zone DB Change-Id: Ib4e0bc567ba8eb54c61c3921d165521bf2f12206 Closes-Bug: #1713875 (cherry picked from commit 12cd654b143e215dbe01cc2688a7d6e6cf3ce62f)
Notes
Notes (review): Code-Review+2: Graham Hayes <gr@ham.ie> Code-Review+2: Erik Olof Gunnar Andersson <eandersson@blizzard.com> Workflow+1: Erik Olof Gunnar Andersson <eandersson@blizzard.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Fri, 19 Oct 2018 00:33:32 +0000 Reviewed-on: https://review.openstack.org/604612 Project: openstack/designate Branch: refs/heads/stable/pike
-rw-r--r--designate/central/service.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/designate/central/service.py b/designate/central/service.py
index 39f742f..a961a66 100644
--- a/designate/central/service.py
+++ b/designate/central/service.py
@@ -2296,6 +2296,7 @@ class Service(service.RPCService, service.Service):
2296 @notification('dns.domain.update') 2296 @notification('dns.domain.update')
2297 @notification('dns.zone.update') 2297 @notification('dns.zone.update')
2298 @transaction 2298 @transaction
2299 @synchronized_zone()
2299 def update_status(self, context, zone_id, status, serial): 2300 def update_status(self, context, zone_id, status, serial):
2300 """ 2301 """
2301 :param context: Security context information. 2302 :param context: Security context information.