theforeman / puppet-pulpcore

Puppet module for setting up Pulp 3 as part of Katello installation
GNU General Public License v3.0
2 stars 28 forks source link

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

Open ehelms opened 4 years ago

ehelms commented 4 years ago

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 commented 4 years ago

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.