Charmed Designate keeps updating zones at all time

Bug #2003528 reported by DUFOUR Olivier
30
This bug affects 5 people
Affects Status Importance Assigned to Milestone
OpenStack Designate Charm
Fix Released
Undecided
DUFOUR Olivier

Bug Description

Charmed Designate is continuously updating the zones even when there is no activity on the cloud.
While this is not a big issue when having one zone. However because of the frequency and potentially having multiple zones updated at the same time, this can create a resource shortage on controller nodes hosting designate units.
This does not happen on a Devstack deployment test.

Issue is seen at least on :
* Juju 2.9.38
* Openstack : Focal-Yoga / Jammy-Yoga / Jammy-Zed
* Designate charm : yoga/stable & latest/edge
* Designate-bind charm : yoga/stable & latest/edge
* in non HA using based on the bundle for testing here : https://opendev.org/openstack/charm-designate/src/branch/master/src/tests/bundles/jammy-zed.yaml
* there are no resources in the cloud aside from 2~3 zones with 2 records in each zone.

#
# Updates from Designate-worker process on designate/0 unit
# 117 AXFR updates in 20 minutes for one zone from one designate unit
#
2023-01-20 03:48:13.773 467 DEBUG designate.dnsutils [None designate-manage - - - all - -] AXFR Successful for example0.com. do_axfr /usr/lib/python3/dist-packages/designate/dnsutils.py:370
2023-01-20 03:48:13.936 467 DEBUG designate.dnsutils [None designate-manage - - - all - -] AXFR Successful for example0.com. do_axfr /usr/lib/python3/dist-packages/designate/dnsutils.py:370
...
...
2023-01-20 04:08:18.319 467 DEBUG designate.dnsutils [None designate-manage - - - all - -] AXFR Successful for example0.com. do_axfr /usr/lib/python3/dist-packages/designate/dnsutils.py:370
ubuntu@juju-e4c10f-2-lxd-0:~$ sudo cat /var/log/designate/designate-worker.log | grep "AXFR Successful" | grep example0.com. | grep 2023-01-20 | wc -l
117
ubuntu@juju-e4c10f-2-lxd-0:~$ date
Fri Jan 20 04:09:20 UTC 2023

#
# Charmed Openstack Jammy Zed deployment
# Zones get updated constantly and the Serial keeps changing with time
#
ubuntu@maas:~$ date; openstack zone list
Fri Jan 20 03:46:40 UTC 2023
+---------------+------------+--------+
| name | serial | status |
+---------------+------------+--------+
| example0.com. | 1674186223 | ACTIVE |
| example1.com. | 1674186223 | ACTIVE |
+---------------+------------+--------+
ubuntu@maas:~$ sleep 300; date; openstack zone list
Fri Jan 20 03:51:48 UTC 2023
+---------------+------------+--------+
| name | serial | status |
+---------------+------------+--------+
| example0.com. | 1674186493 | ACTIVE |
| example1.com. | 1674186493 | ACTIVE |
+---------------+------------+--------+
ubuntu@maas:~$ sleep 300; date; openstack zone list
Fri Jan 20 04:06:01 UTC 2023
+---------------+------------+--------+
| name | serial | status |
+---------------+------------+--------+
| example0.com. | 1674187431 | ACTIVE |
| example1.com. | 1674187431 | ACTIVE |
+---------------+------------+--------+

#
# Devstack zone serial updates
# The zones doesn't get updated at all once all records are created, and the serial stays the same
#
ubuntu@devstack:~$ date; openstack zone list
Fri Jan 20 03:44:04 UTC 2023
+---------------+------------+--------+
| name | serial | status |
+---------------+------------+--------+
| example2.com. | 1674186154 | ACTIVE |
| example1.com. | 1674186154 | ACTIVE |
| example0.com. | 1674186154 | ACTIVE |
+---------------+------------+--------+
ubuntu@devstack:~$ sleep 300; date; openstack zone list
Fri Jan 20 03:49:11 UTC 2023
+---------------+------------+--------+
| name | serial | status |
+---------------+------------+--------+
| example2.com. | 1674186154 | ACTIVE |
| example1.com. | 1674186154 | ACTIVE |
| example0.com. | 1674186154 | ACTIVE |
+---------------+------------+--------+
ubuntu@devstack:~$ sleep 300; date; openstack zone list
Fri Jan 20 04:05:59 UTC 2023
+---------------+------------+--------+
| name | serial | status |
+---------------+------------+--------+
| example2.com. | 1674186154 | ACTIVE |
| example1.com. | 1674186154 | ACTIVE |
| example0.com. | 1674186154 | ACTIVE |
+---------------+------------+--------+

#
# From Devstack designate-worker logs
#
Once all zones and records are created no actions are seeing at all on the logs from designate-worker
--> Can be seen from devstack_designate-worker.log in the attached archive
--> /etc/designate/designate.conf is included as devstack_designate.conf
--> /etc/designate/pools.yaml is included as devstack_pools.yaml

#
# From Charmed Designate-worker logs
#
The Zones get checked many many times and are constantly getting updated
--> Can be seen from charm_designate-worker.log in the attached archive
--> /etc/designate/designate.conf is included as charm_designate.conf
--> /etc/designate/pools.yaml is included as charm_pools.yaml

#
# Devstack configuration
#
[[local|localrc]]
ADMIN_PASSWORD=secret
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD

enable_service rabbit mysql key

enable_plugin openstack/designate https://opendev.org/openstack/designate

enable_service designate,designate-central,designate-api,designate-worker,designate-zone-manager,designate-producer,designate-mdns
DESIGNATE_BACKEND_DRIVER=bind9

Revision history for this message
DUFOUR Olivier (odufourc) wrote :
Changed in charm-designate:
assignee: nobody → DUFOUR Olivier (odufourc)
status: New → In Progress
Revision history for this message
DUFOUR Olivier (odufourc) wrote :

I've finally found the root cause, and the source is not from Designate configuration but from the charm itself.

After shutting down the juju agent on the Designate unit, the updates suddenly stopped.
Looking more deeply, it seems that the update-status hook runs many handlers that has an impact and creates a modification on the deployment. In particular with the "configure_designate_full" handler which causes an update on all zones managed by Designate at the same. It may as well trigger some race conditions if modification are made during the update-status hook or if the updates takes to long to complete within the update-status window before the hook is retriggered automatically by Juju.

Reactive handlers seen inside update-status (see unit-designate-0.log for the complete logs)
2023-01-30 04:46:57 INFO unit.designate/0.juju-log server.go:316 Invoking reactive handler: reactive/designate_handlers.py:62:set_dns_config_available
2023-01-30 04:46:57 INFO unit.designate/0.juju-log server.go:316 Invoking reactive handler: reactive/designate_handlers.py:86:setup_amqp_req
2023-01-30 04:46:57 INFO unit.designate/0.juju-log server.go:316 Invoking reactive handler: reactive/designate_handlers.py:108:start_designate_services
2023-01-30 04:47:14 INFO unit.designate/0.juju-log server.go:316 Invoking reactive handler: reactive/designate_handlers.py:135:maybe_setup_endpoint
2023-01-30 04:47:14 INFO unit.designate/0.juju-log server.go:316 Invoking reactive handler: reactive/designate_handlers.py:193:configure_designate_full
2023-01-30 04:47:27 INFO unit.designate/0.juju-log server.go:316 Invoking reactive handler: reactive/designate_handlers.py:242:expose_endpoint
2023-01-30 04:47:27 INFO unit.designate/0.juju-log server.go:316 Invoking reactive handler: reactive/designate_handlers.py:251:run_assess_status_on_every_hook
2023-01-30 04:47:27 INFO unit.designate/0.juju-log server.go:316 Invoking reactive handler: reactive/layer_openstack.py:82:check_really_is_update_status
2023-01-30 04:47:27 INFO unit.designate/0.juju-log server.go:316 Invoking reactive handler: hooks/relations/keystone/requires.py:100:joined:identity-service
2023-01-30 04:47:27 INFO unit.designate/0.juju-log server.go:316 Invoking reactive handler: hooks/relations/tls-certificates/requires.py:109:broken:certificates

Seen in HA deployment :
2023-01-30 08:23:55 INFO unit.designate/0.juju-log server.go:316 Invoking reactive handler: reactive/designate_handlers.py:153:expose_rndc_address
2023-01-30 08:23:55 INFO unit.designate/0.juju-log server.go:316 Invoking reactive handler: reactive/designate_handlers.py:240:cluster_connected

I've made a quick patch setting the following "@reactive.when_not('is-update-status-hook')" on unnecessary handlers.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-designate (master)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-designate (master)

Reviewed: https://review.opendev.org/c/openstack/charm-designate/+/872151
Committed: https://opendev.org/openstack/charm-designate/commit/f84cee2634e6d9605fd154be40f2c04426eba01e
Submitter: "Zuul (22348)"
Branch: master

commit f84cee2634e6d9605fd154be40f2c04426eba01e
Author: Olivier Dufour-Cuvillier <email address hidden>
Date: Mon Jan 30 19:38:02 2023 +0900

    Prevent update-status to run unrequired handlers

    Before, the update-status hook would run many handlers
    that would have been normally done only during
    configuration changes.
    Consequently it creates an impact on the service and
    apply changes every time the hook is triggered, which is
    in most deployments every 5 minutes.
    This prevents the DNS zones managed by Designate to be
    updated constantly and potentially avoid race conditions
    within designate components.

    Closes-bug: #2003528
    Change-Id: I0d4fea182da1316c0c30c143e64fcd2ca682afff

Changed in charm-designate:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-designate (stable/zed)

Fix proposed to branch: stable/zed
Review: https://review.opendev.org/c/openstack/charm-designate/+/872122

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-designate (stable/yoga)

Fix proposed to branch: stable/yoga
Review: https://review.opendev.org/c/openstack/charm-designate/+/872124

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-designate (stable/yoga)

Reviewed: https://review.opendev.org/c/openstack/charm-designate/+/872124
Committed: https://opendev.org/openstack/charm-designate/commit/fd5b1bb1f064a067873c395136e3d3c3614a699a
Submitter: "Zuul (22348)"
Branch: stable/yoga

commit fd5b1bb1f064a067873c395136e3d3c3614a699a
Author: Olivier Dufour-Cuvillier <email address hidden>
Date: Mon Jan 30 19:38:02 2023 +0900

    Prevent update-status to run unrequired handlers

    Before, the update-status hook would run many handlers
    that would have been normally done only during
    configuration changes.
    Consequently it creates an impact on the service and
    apply changes every time the hook is triggered, which is
    in most deployments every 5 minutes.
    This prevents the DNS zones managed by Designate to be
    updated constantly and potentially avoid race conditions
    within designate components.

    Closes-bug: #2003528
    Change-Id: I0d4fea182da1316c0c30c143e64fcd2ca682afff
    (cherry picked from commit f84cee2634e6d9605fd154be40f2c04426eba01e)

tags: added: in-stable-yoga
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-designate (stable/zed)

Reviewed: https://review.opendev.org/c/openstack/charm-designate/+/872122
Committed: https://opendev.org/openstack/charm-designate/commit/11e72d57bc842b84490a70650d5dd5f87e63cdce
Submitter: "Zuul (22348)"
Branch: stable/zed

commit 11e72d57bc842b84490a70650d5dd5f87e63cdce
Author: Olivier Dufour-Cuvillier <email address hidden>
Date: Mon Jan 30 19:38:02 2023 +0900

    Prevent update-status to run unrequired handlers

    Before, the update-status hook would run many handlers
    that would have been normally done only during
    configuration changes.
    Consequently it creates an impact on the service and
    apply changes every time the hook is triggered, which is
    in most deployments every 5 minutes.
    This prevents the DNS zones managed by Designate to be
    updated constantly and potentially avoid race conditions
    within designate components.

    Closes-bug: #2003528
    Change-Id: I0d4fea182da1316c0c30c143e64fcd2ca682afff
    (cherry picked from commit f84cee2634e6d9605fd154be40f2c04426eba01e)

tags: added: in-stable-zed
Revision history for this message
Hua Zhang (zhhuabj) wrote :

Both ussuri and xena have this issue as well, we also have customers running these two versions

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-designate (stable/xena)

Fix proposed to branch: stable/xena
Review: https://review.opendev.org/c/openstack/charm-designate/+/873667

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-designate (stable/ussuri)

Fix proposed to branch: stable/ussuri
Review: https://review.opendev.org/c/openstack/charm-designate/+/873668

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-designate (stable/wallaby)

Fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/charm-designate/+/873707

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-designate (stable/victoria)

Fix proposed to branch: stable/victoria
Review: https://review.opendev.org/c/openstack/charm-designate/+/874350

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-designate (stable/wallaby)

Reviewed: https://review.opendev.org/c/openstack/charm-designate/+/873707
Committed: https://opendev.org/openstack/charm-designate/commit/b779fcb020f2a31ac3ff274e85797534ee644e09
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit b779fcb020f2a31ac3ff274e85797534ee644e09
Author: Olivier Dufour-Cuvillier <email address hidden>
Date: Mon Jan 30 19:38:02 2023 +0900

    Prevent update-status to run unrequired handlers

    Before, the update-status hook would run many handlers
    that would have been normally done only during
    configuration changes.
    Consequently it creates an impact on the service and
    apply changes every time the hook is triggered, which is
    in most deployments every 5 minutes.
    This prevents the DNS zones managed by Designate to be
    updated constantly and potentially avoid race conditions
    within designate components.

    Conflicts:
        src/reactive/designate_handlers.py

    Closes-bug: #2003528
    Change-Id: I0d4fea182da1316c0c30c143e64fcd2ca682afff
    (cherry picked from commit f84cee2634e6d9605fd154be40f2c04426eba01e)
    (cherry picked from commit fd5b1bb1f064a067873c395136e3d3c3614a699a)
    Signed-off-by: zhhuabj <email address hidden>

tags: added: in-stable-wallaby
tags: added: in-stable-xena
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-designate (stable/xena)

Reviewed: https://review.opendev.org/c/openstack/charm-designate/+/873667
Committed: https://opendev.org/openstack/charm-designate/commit/74ce9148d6696bf30a611ed1b92545a5a2261e5e
Submitter: "Zuul (22348)"
Branch: stable/xena

commit 74ce9148d6696bf30a611ed1b92545a5a2261e5e
Author: Olivier Dufour-Cuvillier <email address hidden>
Date: Mon Jan 30 19:38:02 2023 +0900

    Prevent update-status to run unrequired handlers

    Before, the update-status hook would run many handlers
    that would have been normally done only during
    configuration changes.
    Consequently it creates an impact on the service and
    apply changes every time the hook is triggered, which is
    in most deployments every 5 minutes.
    This prevents the DNS zones managed by Designate to be
    updated constantly and potentially avoid race conditions
    within designate components.

    Conflicts:
        src/reactive/designate_handlers.py

    Closes-bug: #2003528
    Change-Id: I0d4fea182da1316c0c30c143e64fcd2ca682afff
    (cherry picked from commit f84cee2634e6d9605fd154be40f2c04426eba01e)
    (cherry picked from commit fd5b1bb1f064a067873c395136e3d3c3614a699a)
    Signed-off-by: zhhuabj <email address hidden>

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-designate (stable/ussuri)

Reviewed: https://review.opendev.org/c/openstack/charm-designate/+/873668
Committed: https://opendev.org/openstack/charm-designate/commit/e410e0fd679802aa3f9e13c1ac7853f841275ae8
Submitter: "Zuul (22348)"
Branch: stable/ussuri

commit e410e0fd679802aa3f9e13c1ac7853f841275ae8
Author: Olivier Dufour-Cuvillier <email address hidden>
Date: Mon Jan 30 19:38:02 2023 +0900

    Prevent update-status to run unrequired handlers

    Before, the update-status hook would run many handlers
    that would have been normally done only during
    configuration changes.
    Consequently it creates an impact on the service and
    apply changes every time the hook is triggered, which is
    in most deployments every 5 minutes.
    This prevents the DNS zones managed by Designate to be
    updated constantly and potentially avoid race conditions
    within designate components.

    Conflicts:
        src/reactive/designate_handlers.py

    Closes-bug: #2003528
    Change-Id: I0d4fea182da1316c0c30c143e64fcd2ca682afff
    (cherry picked from commit f84cee2634e6d9605fd154be40f2c04426eba01e)
    (cherry picked from commit fd5b1bb1f064a067873c395136e3d3c3614a699a)
    Signed-off-by: zhhuabj <email address hidden>

tags: added: in-stable-ussuri
tags: added: in-stable-victoria
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-designate (stable/victoria)

Reviewed: https://review.opendev.org/c/openstack/charm-designate/+/874350
Committed: https://opendev.org/openstack/charm-designate/commit/e4cf863fa7f28ddcc3b1bbe43df4da0e5b40fad5
Submitter: "Zuul (22348)"
Branch: stable/victoria

commit e4cf863fa7f28ddcc3b1bbe43df4da0e5b40fad5
Author: Olivier Dufour-Cuvillier <email address hidden>
Date: Mon Jan 30 19:38:02 2023 +0900

    Prevent update-status to run unrequired handlers

    Before, the update-status hook would run many handlers
    that would have been normally done only during
    configuration changes.
    Consequently it creates an impact on the service and
    apply changes every time the hook is triggered, which is
    in most deployments every 5 minutes.
    This prevents the DNS zones managed by Designate to be
    updated constantly and potentially avoid race conditions
    within designate components.

    Conflicts:
        src/reactive/designate_handlers.py

    Closes-bug: #2003528
    Change-Id: I0d4fea182da1316c0c30c143e64fcd2ca682afff
    (cherry picked from commit f84cee2634e6d9605fd154be40f2c04426eba01e)
    (cherry picked from commit fd5b1bb1f064a067873c395136e3d3c3614a699a)
    Signed-off-by: zhhuabj <email address hidden>

Changed in charm-designate:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.