RFE: keystone-manage db_sync --check

Bug #1642212 reported by Jesse Pretorius
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Wishlist
Richard

Bug Description

In the automation of deployments and upgrades it would be useful to be able to check whether there are any database actions outstanding so that the action can be determined and executed.

Effectively I'm thinking something along the lines of this experience:

Operator (or automation tool) executes: keystone-manage db_sync --check

The tool checks the db state and returns whether there are any migrations to execute (ie --expand), whether there is a --migrate outstanding, whether there is a --contract outstanding, or any combination of the above. If there is nothing left to do, that should be reported too.

Ideally the output should take two forms:

1 - stdout messages... obviously this is useful when executing this by hand
2 - return codes... this is very useful when executing via automation tooling

The return codes need to be actionable - ie I must know which actions are required based on the return code with no ambiguity.

Tags: ops upgrades
tags: added: upgrades
Revision history for this message
Jesse Pretorius (jesse-pretorius) wrote :

As an alternative option to return codes, if the stdout messages were consistent enough to be machine parseable then it would give us the same advantage.

An example:

# keystone-manage db_sync --check

keystone-manage version x.y.z db_sync --check

Check results:

+----------+------------+
| Task | Status |
+----------+------------+
| expand | complete |
| migrate | incomplete |
| contract | incomplete |
+----------+------------+

Revision history for this message
Jesse Pretorius (jesse-pretorius) wrote :

Argh - the font used to render that broke the alignment, but I think you get what I mean

Dolph Mathews (dolph)
Changed in keystone:
importance: Undecided → Wishlist
status: New → Triaged
Revision history for this message
Ian Cordasco (icordasc) wrote :

Jesse, rather than forcing people to parse the table, they should allow format arguments like the openstack CLI does that would allow you to instead receive that as json.

Revision history for this message
Lance Bragstad (lbragstad) wrote :

Ian brings up a good point, and that would work quite well for `keystone-manage doctor` checks. If `doctor -f json` is run, we can return a list of symptoms. Each symptom in the list would have the outcome, the status code, summary, etc...

Revision history for this message
Lance Bragstad (lbragstad) wrote :

On the other hand, the formatting might be something we should track as a separate bug/RFE.

tags: added: ops
Richard (csravelar)
Changed in keystone:
assignee: nobody → Richard (csravelar)
Changed in keystone:
status: Triaged → In Progress
Revision history for this message
Lance Bragstad (lbragstad) wrote :

We did a little discussing about the possible output today in IRC [0].

[0] http://cdn.pasteraw.com/230kik24j4adzna20e162jjhw2y19kg

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/416383
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=d5ce8ea0ed6a3b9f748427d1b552fb88ad738545
Submitter: Jenkins
Branch: master

commit d5ce8ea0ed6a3b9f748427d1b552fb88ad738545
Author: “Richard <email address hidden>
Date: Tue Jan 3 23:48:21 2017 +0000

    Add --check to keystone-manage db_sync command

    This patch adds a new command to the db_sync upgrade commands. --check
    will check the current state of the users upgrade repos and relay info
    back to the user based on what version each command is currently at and
    if the user has any outstanding db_sync commands left to run. It will
    also notify the user if the db_sync commands were not upgraded in order

    Closes-Bug: 1642212
    Change-Id: I79d3640a780d624f14059fe311fafa0542c03357

Changed in keystone:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/keystone 12.0.0.0b1

This issue was fixed in the openstack/keystone 12.0.0.0b1 development milestone.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.