Story #247
closedpulp-manage-db --noop or --check mode
0%
Description
++ This bug was initially created as a clone of Bugzilla Bug #1132663 ++
Description of problem:
Description of problem:
As an operator I want to be able to determine if the database migrations are up to date without making any change to the database.
When running in kubernetes, I need to be able to probe and poll from the worker containers until the db is ready. Without a non-destructive way to check the
db status I have to manually sequence and test the DB status before launching workers.
Version-Release number of selected component (if applicable):
How reproducible:
Steps to Reproduce:
1.
2.
3.
Actual results:
Expected results:
Additional info:
--- Additional comment from jshubin@redhat.com at 11/10/2014 20:35:20 ---
This is needed for puppet-pulp.
+1 ;)
--- Additional comment from jcline@redhat.com at 11/17/2014 15:23:40 ---
https://github.com/pulp/pulp/pull/1307
When this is merged, this can be tested as follows:
1. Ensure the database isn't set up:
a. 'mongo'
b. 'use pulp_database'
c. 'db.dropDatabase()'
2. Run 'pulp-manage-db --dry-run'. It should print all the migrations it would have applied.
3. echo $? should return 1.
4. Run 'pulp-manage-db' and make sure all the migrations are successful.
5. Run 'pulp-manage-db --dry-run' again. This time echo $? should return 0.
--- Additional comment from cduryee@redhat.com at 12/23/2014 20:52:58 ---
fixed in pulp 2.6.0-0.2.beta
--- Additional comment from jshubin@redhat.com at 12/23/2014 20:59:09 ---
(In reply to Chris Duryee from comment #3)
fixed in pulp 2.6.0-0.2.beta
Whattt, awesome.
It looks like from https://github.com/jeremycline/pulp/commit/fe3041bc3bb21a738494b73f982824a8edaf40f4
that it's --dry-run
Any idea if this is an expensive operation, or a quick one? < 3 sec (typically)?
--- Additional comment from jcline@redhat.com at 12/23/2014 23:18:46 ---
(In reply to James (purpleidea) from comment #4)
(In reply to Chris Duryee from comment #3)
fixed in pulp 2.6.0-0.2.beta
Whattt, awesome.
It looks like from
https://github.com/jeremycline/pulp/commit/
fe3041bc3bb21a738494b73f982824a8edaf40f4
that it's --dry-run
Any idea if this is an expensive operation, or a quick one? < 3 sec
(typically)?
I didn't test it with a large data set, but it just checks to see if the current applied migration version is smaller than the current available migration, so it should be very quick.
--- Additional comment from igulina@redhat.com at 01/06/2015 15:07:24 ---
db.dropDatabase()
{ "dropped" : "pulp_database", "ok" : 1 }
exit
sudo -u apache pulp-manage-db --dry-run
Mongo database for connection is version 2.4.6
Loading content types.
Loading type descriptors [docker.json, rpm_support.json, puppet.json, iso_support.json, nodes.json]
Parsing type descriptors
Validating type descriptor syntactic integrity
Validating type descriptor semantic integrity
Would have created or updated the following type definition: docker_image
Would have created or updated the following type definition: distribution
Would have created or updated the following type definition: drpm
Would have created or updated the following type definition: erratum
Would have created or updated the following type definition: package_group
Would have created or updated the following type definition: package_category
Would have created or updated the following type definition: package_environment
Would have created or updated the following type definition: rpm
Would have created or updated the following type definition: srpm
Would have created or updated the following type definition: yum_repo_metadata_file
Would have created or updated the following type definition: puppet_module
Would have created or updated the following type definition: iso
Would have created or updated the following type definition: repository
Would have created or updated the following type definition: node
Content types loaded.
Ensuring the admin role and user are in place.
Mongo database for connection is version 2.4.6
Would have created the admin role.
Would have created the default admin user.
Admin role and user are in place.
Beginning database migrations.
Applying pulp.server.db.migrations version 1
Would have applied migration to pulp.server.db.migrations version 1
Applying pulp.server.db.migrations version 2
....
Applying pulp_rpm.plugins.migrations version 18
Would have applied migration to pulp_rpm.plugins.migrations version 18
echo $?
1
sudo -u apache pulp-manage-db
Mongo database for connection is version 2.4.6
Loading content types.
Loading type descriptors [docker.json, rpm_support.json, puppet.json, iso_support.json, nodes.json]
Parsing type descriptors
Validating type descriptor syntactic integrity
Validating type descriptor semantic integrity
Updating the database with types [docker_image, distribution, drpm, erratum, package_group, package_category, package_environment, rpm, srpm, yum_repo_metadata_file, puppet_module, iso, repository, node]
Content types loaded.
Ensuring the admin role and user are in place.
Mongo database for connection is version 2.4.6
Admin role and user are in place.
Beginning database migrations.
Applying pulp.server.db.migrations version 1
Migration to pulp.server.db.migrations version 1 complete.
Applying pulp.server.db.migrations version 2
...
Applying pulp_rpm.plugins.migrations version 16
Loaded plugin yum_distributor for types: rpm,srpm,drpm,erratum,package_group,package_category,distribution,yum_repo_metadata_file
Loaded plugin export_distributor for types: rpm,srpm,drpm,erratum,distribution,package_category,package_group
Loaded plugin iso_distributor for types: iso
Loaded plugin docker_distributor_web for types: docker_image
Loaded plugin docker_distributor_export for types: docker_image
Loaded plugin puppet_distributor for types: puppet_module
Loaded plugin puppet_file_distributor for types: puppet_module
Loaded plugin puppet_install_distributor for types: puppet_module
Loaded plugin nodes_http_distributor for types: node
Loaded plugin group_export_distributor for types: rpm,srpm,drpm,erratum,distribution,package_category,package_group
Loaded plugin yum_importer for types: distribution,drpm,erratum,package_group,package_category,rpm,srpm,yum_repo_metadata_file,package_environment
Loaded plugin iso_importer for types: iso
Loaded plugin docker_importer for types: docker_image
Loaded plugin nodes_http_importer for types: node,repository
Loaded plugin puppet_importer for types: puppet_module
Loaded plugin yum_profiler for types: rpm,erratum
Loaded plugin puppet_whole_repo_profiler for types: puppet_module
Loaded plugin node for types: node,repository
Loaded plugin yum for types: rpm
Loaded plugin rhui for types: rpm
Migration to pulp_rpm.plugins.migrations version 16 complete.
Applying pulp_rpm.plugins.migrations version 17
Migration to pulp_rpm.plugins.migrations version 17 complete.
Applying pulp_rpm.plugins.migrations version 18
Migration to pulp_rpm.plugins.migrations version 18 complete.
Database migrations complete.
sudo -u apache pulp-manage-db --dry-run
Mongo database for connection is version 2.4.6
Loading content types.
Loading type descriptors [docker.json, rpm_support.json, puppet.json, iso_support.json, nodes.json]
Parsing type descriptors
Validating type descriptor syntactic integrity
Validating type descriptor semantic integrity
Content types loaded.
Ensuring the admin role and user are in place.
Mongo database for connection is version 2.4.6
Admin role and user are in place.
Beginning database migrations.
Migration package pulp.server.db.migrations is up to date at version 12
Migration package pulp_puppet.plugins.migrations is up to date at version 2
Migration package pulp_rpm.plugins.migrations is up to date at version 18
Database migrations complete.
echo $?
0
Updated by bmbouter over 9 years ago
- Status changed from NEW to 6
This was already at VERIFIED state in Bugzilla. There was an error in the migration into Redmine. This change sets the correct state.
Updated by bmbouter over 9 years ago
- Platform Release deleted (
2.6.0) - Target Release - Docker set to 1.0.0
Updated by bmbouter over 9 years ago
- Project changed from Docker Support to Pulp
- Platform Release set to 2.6.0
This is supposed to be against platform.
Updated by bmbouter over 9 years ago
- Subject changed from RFE: pulp-manage-db --noop or --check mode to pulp-manage-db --noop or --check mode
Updated by rbarlow over 9 years ago
- Status changed from 6 to CLOSED - CURRENTRELEASE