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

Fixes #27540 - handle local pgsql start #379

Merged
merged 4 commits into from Aug 12, 2019

Conversation

@upadhyeammit
Copy link
Contributor

upadhyeammit commented Aug 7, 2019

The upgrade tries to start local pgsql, mongodb services. To handle this one,

  • The foreman-maintain is smart to check if service is local or external, so if system has foreman-maintain I am calling it to start service.
  • When foreman-maintain is not available, I tried to handle two conditions,
    • pgsql and mongo are on external system, in this case I have checked if service file is there, if yes then only start/stop service.
    • pgsql and mongo are on local system, start or stop using the systemctl.
@upadhyeammit

This comment has been minimized.

Copy link
Contributor Author

upadhyeammit commented Aug 7, 2019

If I see then pgsql and mongo can be external services so I have not changed other service calls, like for tomcat, pulp. If its wise to change it for all services then will add changes accordingly.
Thank You!

Copy link
Member

ekohl left a comment

What I don't like about this is the reliance on foreman-maintain. I'm aware that we already rely on it in some parts and I'm also unhappy about that.

One reason for this is that in the mongodb migration it should fail if it's unavailable because it can only work on a local machine.

I would much rather see that we look at the actual answers as the installer should. That means the line becomes:

if param_value('foreman', 'db_manage') || param_value('katello', 'candlepin_manage_db')
  upgrade_step :start_postgresql, :run_always => true
end

It might also be good to add --exclude postgresql to the stop_services method.

@upadhyeammit

This comment has been minimized.

Copy link
Contributor Author

upadhyeammit commented Aug 8, 2019

@ekohl I reverted changes. I did not skip pgsql stop because foreman-maintain handles it, if pgsql is external it wont stop it.
Thank you !

@@ -53,7 +53,7 @@ def mongo_mmapv1_check
logger.info 'No changed needed, Mongo storage engine will installed/kept with WiredTiger'
else
# Stop Mongo 2.x
Kafo::Helpers.execute('systemctl stop mongod')
Kafo::Helpers.stop_service('mongod')

This comment has been minimized.

Copy link
@ekohl

ekohl Aug 8, 2019

Member

Leftover here that can be reverted.

katello/hooks/pre/30-upgrade.rb Outdated Show resolved Hide resolved
@upadhyeammit

This comment has been minimized.

Copy link
Contributor Author

upadhyeammit commented Aug 12, 2019

@ekohl removed the extra if condition, miss from my side! Thank You!

@ekohl
ekohl approved these changes Aug 12, 2019
@ekohl ekohl merged commit e6974d9 into theforeman:develop Aug 12, 2019
2 checks passed
2 checks passed
Redmine issues Valid issues
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@tbrisker

This comment has been minimized.

Copy link
Member

tbrisker commented Aug 28, 2019

1.23 - b6a7147
1.22 - 0916d55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.