Project

Profile

Help

Issue #2776

closed

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

Added by gmbnomis almost 7 years ago. Updated about 5 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.

Actions #1

Updated by ttereshc almost 7 years ago

  • Triaged changed from No to Yes
Actions #2

Updated by bmbouter almost 7 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

Actions #3

Updated by gmbnomis almost 7 years ago

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

Actions #4

Updated by bmbouter almost 7 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 almost 7 years ago

Revision 4bde91e5 | View on GitHub

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

Actions #5

Updated by bizhang almost 7 years ago

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

Added by werwty almost 7 years ago

Revision b9fa19d9 | View on GitHub

Merge pull request #3037 from ehelms/fixes-2776

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

Actions #6

Updated by Anonymous almost 7 years ago

  • Status changed from POST to MODIFIED
Actions #8

Updated by pcreech almost 7 years ago

  • Platform Release set to 2.13.2
Actions #10

Updated by pcreech almost 7 years ago

  • Status changed from MODIFIED to 5
Actions #12

Updated by pcreech almost 7 years ago

  • Status changed from 5 to CLOSED - CURRENTRELEASE
Actions #13

Updated by bmbouter about 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF