Race condition in designate-sink when deleting records
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Designate |
Fix Released
|
High
|
Unassigned | ||
kolla-ansible |
Invalid
|
Undecided
|
Unassigned |
Bug Description
What happened: After rebuilding clusters from Queens to Train, deleting a VM and then immediately creating a new one with the same name and IP (via Terraform for example) intermittently results in a missing DNS record.
Before applying the change, we see the DNS record in the recordset:
$ openstack recordset list dva3.<DOM>. --all |grep openstack-terra
| f9aa73c1-
$
and we can pull it from the DNS server on the controllers:
$ for i in {1..3}; do dig @dva3-ctrl$
openstack-
openstack-
openstack-
After applying the change, we don't see it:
$ openstack recordset list dva3.<DOM>. --all |grep openstack-terra
$ for i in {1..3}; do dig @dva3-ctrl$
$
We see this in the logs:
2021-10-09 01:53:44.307 27 ERROR oslo_messaging.
2021-10-09 01:53:44.307 27 ERROR oslo_messaging.
2021-10-09 01:53:44.307 27 ERROR oslo_messaging.
It appears that Designate is trying to create the new record before the deletion of the old one finishes.
Expected behavior: Designate waits for the old record to finish deleting before attempting to create the new one.
How to reproduce: Use Terraform to create a VM with a port. Taint the VM and run Terraform apply so that the VM is deleted and immediately re-created with the same name and IP.
OS: Centos 8
Kernel: 4.18.0-
Docker version: 20.10.7
Kolla-Ansible version: stable/train
Changed in designate: | |
status: | New → Confirmed |
importance: | Undecided → High |
Changed in kolla-ansible: | |
status: | New → Invalid |
Reviewed: https:/ /review. opendev. org/c/openstack /designate/ +/814290 /opendev. org/openstack/ designate/ commit/ 4807c23228fbb23 af3087ee072bf73 d7fc43aff5
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit 4807c23228fbb23 af3087ee072bf73 d7fc43aff5
Author: Erik Olof Gunnar Andersson <email address hidden>
Date: Sun Oct 17 03:05:28 2021 -0700
Fix race condition in the sink when deleting records
Updated the sink to behave closer to how we handle this type
of operations in designate.api.v2.
- Added object validation to all requests.
- Better test coverage.
- Use recordset update / delete instead of just record delete.
Closes-Bug: #1947765 0a4d17471ab794c a717706823d
Change-Id: I867600eb48a3e3