Issue #2776
closedpulp-manage-db requires pulp services to be shut down even in dry run mode
Description
In our automation scripts, we run pulp-manage-db in dry-run mode in order to check whether we need to apply migrations (pulp-manage-db returns a specific error code in that case). This may happen in two situations:
1. We actually did a Pulp upgrade (in that case Pulp services are not activated when the check is run)
2. Something went very wrong and there are migrations to be applied although Pulp is running
With Pulp 2.13 (and maybe earlier, we ran 2.10 before), we cannot use pulp-manage-db for the second case anymore since it refuses to run in dry run mode when Pulp services are running. Of course, we don't want to stop/start services just to check for a case that is not supposed to happen. (Nevertheless, we think this check delivers an important signal if it triggers)
How to reproduce:
Run sudo -u apache pulp-manage-db --dry-run
on a running Pulp server. pulp-manage-db will wait for 90 seconds and exit with an error, i.e. not doing any checks.
The expected behavior is to actually do the DB checks in dry run mode instead.
Updated by bmbouter about 6 years ago
- Tags Easy Fix added
gmbnomis, thank you for filing this. It should be an easy fix. The quickest way to get it resolved is if you can submit a PR for it. I think you just need to guard this code[0] with an if statement that checks to see if dry-run is True.
Pulp has a Vagrant developer environment [1] which should make it easier to have an environment to test with. If there is any way we can help you with your contribution please let us know.
[0]: https://github.com/pulp/pulp/blob/798a9315c42f624bcf2a785acd19ee7c194e77d4/server/pulp/server/db/manage.py#L200
[1]: http://docs.pulpproject.org/dev-guide/contributing/dev_setup.html#vagrant
Updated by gmbnomis about 6 years ago
bmbouter: PR looks doable. Should it be for '2.13-dev' or for master?
Updated by bmbouter about 6 years ago
gmbnomis Great. Yes, please target 2.13-dev. You may find these docs helpful: http://docs.pulpproject.org/dev-guide/contributing/branching.html#bug-fix-branches
Also, I'm 'bmbouter' in #pulp-dev if you want to ask any questions there.
Added by Eric D. Helms about 6 years ago
Updated by bizhang about 6 years ago
- Status changed from NEW to POST
- Assignee set to ehelms@redhat.com
Added by werwty about 6 years ago
Updated by Anonymous about 6 years ago
- Status changed from POST to MODIFIED
Applied in changeset pulp|4bde91e5127ab78b8701947761a3a23d7d99b30c.
Updated by werwty about 6 years ago
Applied in changeset pulp|b9fa19d915393264412177aabd908e266e448079.
Updated by pcreech almost 6 years ago
- Status changed from 5 to CLOSED - CURRENTRELEASE
Fixes #2776: Don't check for active works in dry-run