Create databases and users is called on every hook execution

Bug #1871958 reported by David Ames
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL InnoDB Cluster Charm
Fix Released
High
David Ames

Bug Description

Create databases and users is called on every hook execution. This is inefficient and necessary.

TRIAGE:
After confirmation of handling requests the following flags should be cleared:
reactive.clear_flag('endpoint.db-router.changed')
reactive.clear_flag('endpoint.share-db.changed')

This will stop further calls to create_databases_and_users() until a new change on the relation occurs.

David Ames (thedac)
Changed in charm-mysql-innodb-cluster:
status: New → Triaged
importance: Undecided → High
assignee: nobody → David Ames (thedac)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-mysql-innodb-cluster (master)

Fix proposed to branch: master
Review: https://review.opendev.org/719106

Changed in charm-mysql-innodb-cluster:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-mysql-innodb-cluster (master)

Reviewed: https://review.opendev.org/719106
Committed: https://git.openstack.org/cgit/openstack/charm-mysql-innodb-cluster/commit/?id=101b7f370dfd4de156a259fdf380a47e305c9bde
Submitter: Zuul
Branch: master

commit 101b7f370dfd4de156a259fdf380a47e305c9bde
Author: David Ames <email address hidden>
Date: Fri Apr 10 09:48:44 2020 -0700

    Only run DB/user creation on relation data change

    Before this change DB and user creation methods were called on every
    hook execution after <interface>.available was established.

    This change checks for both endpoint.<interface>.changed and
    <interface.available> before running DB and user creation methods.

    It also validates that the creation of DB and users succeeded before
    clearing the endpoint.<interface>.changed flag.

    Closes-Bug: #1871958
    Change-Id: I20f2eabbf622b44be31742678ffd9724b1e00c8a

Changed in charm-mysql-innodb-cluster:
status: In Progress → Fix Committed
David Ames (thedac)
Changed in charm-mysql-innodb-cluster:
milestone: none → 20.05
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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