mysql> select * from zone_masters;
Empty set (0.00 sec)
it seems the return value of self.storage.get_zone(context, zone_id) didn't include zone_master so zone.masters is []
(Pdb) l
373 attr = self._find_zone_masters(
374 context, {'id': i_id}, one=True)
375 self.delete_zone_master(context, attr.id)
376
377 # Update Attributes
378 -> for i in update:
379 self.update_zone_master(context, i)
380
381 # Create Attributes
382 for attr in create:
383 attr.zone_id = zone.id
(Pdb) p have
{'10a355b8-d22d-41ae-8c35-d52ce8db1ae5'}
(Pdb) p keep
set()
(Pdb) p update
[]
(Pdb) p create
[]
(Pdb) p zone.obj_attr_is_set('masters')
True
(Pdb) p i_id
'10a355b8-d22d-41ae-8c35-d52ce8db1ae5'
(Pdb) p zone.masters
OVO Objects
(Pdb) print(list(zone.masters))
[]
I did some debug, zone_master record was deleted by delete_zone_master, here is its call stack
mysql> select * from zone_masters; ------- ------- ------- ------- +------ ---+--- ------- ------- ----+-- ------- ------- -----+- ------- ----+-- ----+-- ------- ------- ------- ------- ----+ ------- ------- ------- ------- +------ ---+--- ------- ------- ----+-- ------- ------- -----+- ------- ----+-- ----+-- ------- ------- ------- ------- ----+ e8c35d52ce8db1a e5 | 214 | 2022-11-28 08:21:44 | 2022-11-28 08:22:20 | 10.5.2.242 | 5354 | 30ebe0fdd67647d 885f93eb817328c 6b | ------- ------- ------- ------- +------ ---+--- ------- ------- ----+-- ------- ------- -----+- ------- ----+-- ----+-- ------- ------- ------- ------- ----+
+------
| id | version | created_at | updated_at | host | port | zone_id |
+------
| 10a355b8d22d41a
+------
# nc 127.0.0.1 4444 python3/ dist-packages/ designate/ storage/ impl_sqlalchemy /__init_ _.py(586) delete_ zone_master( ) zone_masters( lib/python3/ dist-packages/ eventlet/ greenpool. py(88)_ spawn_n_ impl() lib/python3/ dist-packages/ futurist/ _green. py(71)_ _call__ () lib/python3/ dist-packages/ futurist/ _utils. py(52)run( ) lib/python3/ dist-packages/ oslo_messaging/ rpc/server. py(165) _process_ incoming( ) .dispatch( message) lib/python3/ dist-packages/ oslo_messaging/ rpc/dispatcher. py(276) dispatch( ) dispatch( endpoint, method, ctxt, args) lib/python3/ dist-packages/ oslo_messaging/ rpc/dispatcher. py(196) _do_dispatch( ) lib/python3/ dist-packages/ designate/ rpc.py( 238)exception_ wrapper( ) lib/python3/ dist-packages/ designate/ central/ service. py(151) notification_ wrapper( ) lib/python3/ dist-packages/ designate/ central/ service. py(151) notification_ wrapper( ) lib/python3/ dist-packages/ designate/ storage/ __init_ _.py(67) retry_wrapper( ) deepcopy( kwargs) ) lib/python3/ dist-packages/ designate/ storage/ __init_ _.py(105) transaction_ wrapper( ) lib/python3/ dist-packages/ designate/ central/ service. py(123) sync_wrapper( ) lib/python3/ dist-packages/ designate/ central/ service. py(2380) update_ status( ) zone_status( context, zone_id, status, serial) lib/python3/ dist-packages/ designate/ central/ service. py(2397) _update_ zone_status( ) update_ zone(context, zone) lib/python3/ dist-packages/ designate/ storage/ impl_sqlalchemy /__init_ _.py(375) update_ zone() zone_master( context, attr.id) python3/ dist-packages/ designate/ storage/ impl_sqlalchemy /__init_ _.py(586) delete_ zone_master( ) zone_masters(
> /usr/lib/
-> zone_master = self._find_
(Pdb) where
/usr/
-> func(*args, **kwargs)
/usr/
-> self.work.run()
/usr/
-> result = self.fn(*self.args, **self.kwargs)
/usr/
-> res = self.dispatcher
/usr/
-> return self._do_
/usr/
-> result = func(ctxt, **new_args)
/usr/
-> return f(self, *args, **kwargs)
/usr/
-> result = f(self, *args, **kwargs)
/usr/
-> result = f(self, *args, **kwargs)
/usr/
-> **copy.
/usr/
-> result = f(self, *args, **kwargs)
/usr/
-> return f(self, *args, **kwargs)
/usr/
-> zone = self._update_
/usr/
-> self.storage.
/usr/
-> self.delete_
> /usr/lib/
-> zone_master = self._find_
mysql> select * from zone_masters;
Empty set (0.00 sec)
it seems the return value of self.storage. get_zone( context, zone_id) didn't include zone_master so zone.masters is []
(Pdb) l zone_masters( zone_master( context, attr.id) zone_master( context, i) d22d-41ae- 8c35-d52ce8db1a e5'} attr_is_ set('masters' ) d22d-41ae- 8c35-d52ce8db1a e5' zone.masters) )
373 attr = self._find_
374 context, {'id': i_id}, one=True)
375 self.delete_
376
377 # Update Attributes
378 -> for i in update:
379 self.update_
380
381 # Create Attributes
382 for attr in create:
383 attr.zone_id = zone.id
(Pdb) p have
{'10a355b8-
(Pdb) p keep
set()
(Pdb) p update
[]
(Pdb) p create
[]
(Pdb) p zone.obj_
True
(Pdb) p i_id
'10a355b8-
(Pdb) p zone.masters
OVO Objects
(Pdb) print(list(
[]