Browse Source

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
Arjun Baindur 8 months ago
parent
commit
12cd654b14
1 changed files with 1 additions and 0 deletions
  1. 1
    0
      designate/central/service.py

+ 1
- 0
designate/central/service.py View File

@@ -2302,6 +2302,7 @@ class Service(service.RPCService, service.Service):
2302 2302
     @notification('dns.domain.update')
2303 2303
     @notification('dns.zone.update')
2304 2304
     @transaction
2305
+    @synchronized_zone()
2305 2306
     def update_status(self, context, zone_id, status, serial):
2306 2307
         """
2307 2308
         :param context: Security context information.

Loading…
Cancel
Save