Project

Profile

Help

Issue #2776

pulp-manage-db requires pulp services to be shut down even in dry run mode

Added by gmbnomis over 4 years ago. Updated almost 3 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
2.13.0
Platform Release:
2.13.2
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Easy Fix, Pulp 2
Sprint:
Quarter:

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.

Associated revisions

Revision 4bde91e5 View on GitHub
Added by Eric D. Helms over 4 years ago

Fixes #2776: Don't check for active works in dry-run

Revision b9fa19d9 View on GitHub
Added by werwty over 4 years ago

Merge pull request #3037 from ehelms/fixes-2776

Fixes #2776: Don't check for active works in dry-run

History

#1 Updated by ttereshc over 4 years ago

  • Triaged changed from No to Yes

#2 Updated by bmbouter over 4 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

#3 Updated by gmbnomis over 4 years ago

bmbouter: PR looks doable. Should it be for '2.13-dev' or for master?

#4 Updated by bmbouter over 4 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.

#5 Updated by bizhang over 4 years ago

  • Status changed from NEW to POST
  • Assignee set to ehelms@redhat.com

#6 Updated by Anonymous over 4 years ago

  • Status changed from POST to MODIFIED

#8 Updated by pcreech over 4 years ago

  • Platform Release set to 2.13.2

#10 Updated by pcreech over 4 years ago

  • Status changed from MODIFIED to 5

#12 Updated by pcreech over 4 years ago

  • Status changed from 5 to CLOSED - CURRENTRELEASE

#13 Updated by bmbouter almost 3 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF