Skip to content

Conversation

@dragomirp
Copy link
Contributor

@dragomirp dragomirp commented Nov 12, 2023

Issue

Starting a connection for each db to enable or disable plugins will take more and more time as the number of plugins increases.

Solution

Open a single connection per db and enable or disable the plugins in one go.

self.unit.status = original_status
extension = plugins_exception.get(extension, extension)
extensions[extension] = enable
self.unit.status = WaitingStatus("Updating extensions")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can no longer tell if we are enabling or disabling and which plugin.

Comment on lines -155 to -157
# Enable/disable extensions in the new database.
self.charm.enable_disable_extensions(database)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be done anyway on line 153

Copy link
Contributor

@taurus-forever taurus-forever left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Can we improve the test to make sure at least some extension(s) are enabled?

Copy link
Member

@marceloneppel marceloneppel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the great improvement!

@dragomirp
Copy link
Contributor Author

dragomirp commented Nov 16, 2023

LGTM. Can we improve the test to make sure at least some extension(s) are enabled?

Will add additional test for this as part of DPE-2844, since I want to unblock pending plugin PRs.

@dragomirp dragomirp merged commit d854da8 into main Nov 16, 2023
@dragomirp dragomirp deleted the dpe-2903-plugins-restore branch November 16, 2023 12:02
marceloneppel pushed a commit that referenced this pull request Nov 22, 2023
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
marceloneppel pushed a commit that referenced this pull request Nov 22, 2023
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
BON4 pushed a commit to BON4/postgresql-k8s-operator that referenced this pull request May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants