Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should full database refresh be triggered on plugin enablement? #51

Open
ehelms opened this issue Dec 16, 2019 · 1 comment
Open

Should full database refresh be triggered on plugin enablement? #51

ehelms opened this issue Dec 16, 2019 · 1 comment

Comments

@ehelms
Copy link
Member

ehelms commented Dec 16, 2019

Enabling a plugin seems to refresh all of database creation, I would think it would just refresh the migrate.

[ INFO 2019-12-16T17:09:18 verbose]  Pulpcore::Plugin[container]: Scheduling refresh of Class[Pulpcore::Service]
[ INFO 2019-12-16T17:09:18 verbose]  Class[Pulpcore::Database]: Scheduling refresh of Postgresql::Server::Db[pulpcore]
[ INFO 2019-12-16T17:09:18 verbose]  Class[Pulpcore::Database]: Scheduling refresh of Pulpcore::Admin[migrate --noinput]
[ INFO 2019-12-16T17:09:18 verbose]  Postgresql::Server::Db[pulpcore]: Scheduling refresh of Postgresql::Server::Database[pulpcore]
[ INFO 2019-12-16T17:09:18 verbose]  Postgresql::Server::Db[pulpcore]: Scheduling refresh of Postgresql::Server::Role[pulp]
[ INFO 2019-12-16T17:09:18 verbose]  Postgresql::Server::Db[pulpcore]: Scheduling refresh of Postgresql::Server::Database_grant[GRANT pulp - ALL - pulpcore]
[ INFO 2019-12-16T17:09:18 verbose]  Postgresql::Server::Role[pulp]: Scheduling refresh of Postgresql_psql[CREATE ROLE pulp ENCRYPTED PASSWORD ****]
[ INFO 2019-12-16T17:09:18 verbose]  Postgresql::Server::Role[pulp]: Scheduling refresh of Postgresql_psql[ALTER ROLE "pulp" NOSUPERUSER]
[ INFO 2019-12-16T17:09:18 verbose]  Postgresql::Server::Role[pulp]: Scheduling refresh of Postgresql_psql[ALTER ROLE "pulp" NOCREATEDB]
[ INFO 2019-12-16T17:09:18 verbose]  Postgresql::Server::Role[pulp]: Scheduling refresh of Postgresql_psql[ALTER ROLE "pulp" NOCREATEROLE]
[ INFO 2019-12-16T17:09:18 verbose]  Postgresql::Server::Role[pulp]: Scheduling refresh of Postgresql_psql[ALTER ROLE "pulp" LOGIN]
[ INFO 2019-12-16T17:09:18 verbose]  Postgresql::Server::Role[pulp]: Scheduling refresh of Postgresql_psql[ALTER ROLE "pulp" INHERIT]
[ INFO 2019-12-16T17:09:18 verbose]  Postgresql::Server::Role[pulp]: Scheduling refresh of Postgresql_psql[ALTER ROLE "pulp" NOREPLICATION]
[ INFO 2019-12-16T17:09:18 verbose]  Postgresql::Server::Role[pulp]: Scheduling refresh of Postgresql_psql[ALTER ROLE "pulp" CONNECTION LIMIT -1]
[ INFO 2019-12-16T17:09:18 verbose]  Postgresql::Server::Role[pulp]: Scheduling refresh of Postgresql_psql[ALTER ROLE pulp ENCRYPTED PASSWORD ****]
[ INFO 2019-12-16T17:09:18 verbose]  Postgresql::Server::Database_grant[GRANT pulp - ALL - pulpcore]: Scheduling refresh of Postgresql::Server::Grant[database:GRANT pulp - ALL - pulpcore]
[ WARN 2019-12-16T17:09:18 verbose]  /Stage[main]/Pulpcore::Database/Postgresql::Server::Db[pulpcore]/Postgresql::Server::Role[pulp]/Postgresql_psql[CREATE ROLE pulp ENCRYPTED PASSWORD ****]: Triggered 'refresh' from 1 event
[ WARN 2019-12-16T17:09:18 verbose]  /Stage[main]/Pulpcore::Database/Postgresql::Server::Db[pulpcore]/Postgresql::Server::Role[pulp]/Postgresql_psql[ALTER ROLE "pulp" NOSUPERUSER]: Triggered 'refresh' from 1 event
[ WARN 2019-12-16T17:09:18 verbose]  /Stage[main]/Pulpcore::Database/Postgresql::Server::Db[pulpcore]/Postgresql::Server::Role[pulp]/Postgresql_psql[ALTER ROLE "pulp" NOCREATEDB]: Triggered 'refresh' from 1 event
[ WARN 2019-12-16T17:09:18 verbose]  /Stage[main]/Pulpcore::Database/Postgresql::Server::Db[pulpcore]/Postgresql::Server::Role[pulp]/Postgresql_psql[ALTER ROLE "pulp" NOCREATEROLE]: Triggered 'refresh' from 1 event
[ WARN 2019-12-16T17:09:18 verbose]  /Stage[main]/Pulpcore::Database/Postgresql::Server::Db[pulpcore]/Postgresql::Server::Role[pulp]/Postgresql_psql[ALTER ROLE "pulp" LOGIN]: Triggered 'refresh' from 1 event
[ WARN 2019-12-16T17:09:18 verbose]  /Stage[main]/Pulpcore::Database/Postgresql::Server::Db[pulpcore]/Postgresql::Server::Role[pulp]/Postgresql_psql[ALTER ROLE "pulp" INHERIT]: Triggered 'refresh' from 1 event
[ WARN 2019-12-16T17:09:18 verbose]  /Stage[main]/Pulpcore::Database/Postgresql::Server::Db[pulpcore]/Postgresql::Server::Role[pulp]/Postgresql_psql[ALTER ROLE "pulp" NOREPLICATION]: Triggered 'refresh' from 1 event
[ WARN 2019-12-16T17:09:18 verbose]  /Stage[main]/Pulpcore::Database/Postgresql::Server::Db[pulpcore]/Postgresql::Server::Role[pulp]/Postgresql_psql[ALTER ROLE "pulp" CONNECTION LIMIT -1]: Triggered 'refresh' from 1 event
[ WARN 2019-12-16T17:09:18 verbose]  /Stage[main]/Pulpcore::Database/Postgresql::Server::Db[pulpcore]/Postgresql::Server::Role[pulp]/Postgresql_psql[ALTER ROLE pulp ENCRYPTED PASSWORD ****]: Triggered 'refresh' from 1 event
[ INFO 2019-12-16T17:09:18 verbose]  Postgresql::Server::Database[pulpcore]: Scheduling refresh of Postgresql_psql[CREATE DATABASE "pulpcore"]
[ INFO 2019-12-16T17:09:18 verbose]  Postgresql::Server::Database[pulpcore]: Scheduling refresh of Postgresql_psql[REVOKE CONNECT ON DATABASE "pulpcore" FROM public]
[ INFO 2019-12-16T17:09:18 verbose]  Postgresql::Server::Database[pulpcore]: Scheduling refresh of Postgresql_psql[UPDATE pg_database SET datistemplate = false WHERE datname = 'pulpcore']
[ WARN 2019-12-16T17:09:18 verbose]  /Stage[main]/Pulpcore::Database/Postgresql::Server::Db[pulpcore]/Postgresql::Server::Database[pulpcore]/Postgresql_psql[CREATE DATABASE "pulpcore"]: Triggered 'refresh' from 1 event
[ INFO 2019-12-16T17:09:18 verbose]  /Stage[main]/Pulpcore::Database/Postgresql::Server::Db[pulpcore]/Postgresql::Server::Database[pulpcore]/Postgresql_psql[CREATE DATABASE "pulpcore"]: Scheduling refresh of Postgresql_psql[REVOKE CONNECT ON DATABASE "pulpcore" FROM public]
[ WARN 2019-12-16T17:09:18 verbose]  /Stage[main]/Pulpcore::Database/Postgresql::Server::Db[pulpcore]/Postgresql::Server::Database[pulpcore]/Postgresql_psql[REVOKE CONNECT ON DATABASE "pulpcore" FROM public]: Triggered 'refresh' from 2 events
[ WARN 2019-12-16T17:09:18 verbose]  /Stage[main]/Pulpcore::Database/Postgresql::Server::Db[pulpcore]/Postgresql::Server::Database[pulpcore]/Postgresql_psql[UPDATE pg_database SET datistemplate = false WHERE datname = 'pulpcore']: Triggered 'refresh' from 1 event
[ INFO 2019-12-16T17:09:18 verbose]  Postgresql::Server::Grant[database:GRANT pulp - ALL - pulpcore]: Scheduling refresh of Postgresql_psql[grant:database:GRANT pulp - ALL - pulpcore]
[ WARN 2019-12-16T17:09:47 verbose]  /Stage[main]/Pulpcore::Database/Postgresql::Server::Db[pulpcore]/Postgresql::Server::Database_grant[GRANT pulp - ALL - pulpcore]/Postgresql::Server::Grant[database:GRANT pulp - ALL - pulpcore]/Postgresql_psql[grant:database:GRANT pulp - ALL - pulpcore]: Triggered 'refresh' from 1 event
[ INFO 2019-12-16T17:09:47 verbose]  Pulpcore::Admin[migrate --noinput]: Scheduling refresh of Exec[python3-django-admin migrate --noinput]
@ekohl
Copy link
Member

ekohl commented Dec 16, 2019

It's idempotent so it'll first check if it really needs to but technically you're right. Installing a plugin should trigger a migrate. The migrate should require the database.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants