Ability to 'verify' an upgrade ahead of attempting it

Bug #1163901 reported by Donald Walker
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
DB Version
Fix Committed
Undecided
Donald Walker

Bug Description

When apply an upgrade using the 'create' command, it would be great to be able to perform the create but at the last moment rollback. This would allow you to see what changes would be made, as well as verifying the actual create is likely to succeed.

Tags: feature

Related branches

Revision history for this message
Donald Walker (donaldw) wrote :

I have implemented this locally as a new IConsoleCommand named 'Check'

Changed in dbversion:
assignee: nobody → Donald Walker (w-launchpad)
status: New → In Progress
Revision history for this message
Donald Walker (donaldw) wrote :

Two 'modes' which seem they would be useful would be:

Check-With-ListChangesButDontRunAnything
Check-With-ExecuteAndRollback

Which I think would be invoked on the command line as:

# Display changes which would be made but don't actually touch the DB
dbversion check -c constring -a archivedir

# Do everything 'create' does, but rollback at the last moment
dbversion check -r -c constring -a archivedir

Any thoughts?

Revision history for this message
Adam Connelly (adam-rpconnelly) wrote : Re: [Bug 1163901] Re: Ability to test apply an upgrade

That sounds cool. I was going to say that we could just use a flag on
the create command except that you mentioned a mode where it doesn't
even hit the database.

The only thing I'd say is that you probably want to flip it round
slightly. The fact that we're doing a check rather than the full
create implies that we don't want to apply the changes, so instead of
having an option to specify whether you rollback or not, I'd have an
option to specify that we don't want to touch the database at all (-s,
--simulate maybe? You can probably come up with a better name).

Cheers,
Adam

On 3 Apr 2013, at 14:15, Donald Walker <email address hidden> wrote:

> Two 'modes' which seem they would be useful would be:
>
> Check-With-ListChangesButDontRunAnything
> Check-With-ExecuteAndRollback
>
> Which I think would be invoked on the command line as:
>
> # Display changes which would be made but don't actually touch the DB
> dbversion check -c constring -a archivedir
>
> # Do everything 'create' does, but rollback at the last moment
> dbversion check -r -c constring -a archivedir
>
> Any thoughts?
>
> --
> You received this bug notification because you are subscribed to DB
> Version.
> https://bugs.launchpad.net/bugs/1163901
>
> Title:
> Ability to test apply an upgrade
>
> Status in DB Version:
> In Progress
>
> Bug description:
> When apply an upgrade using the 'create' command, it would be great to
> be able to perform the create but at the last moment rollback. This
> would allow you to see what changes would be made, as well as
> verifying the actual create is likely to succeed.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/dbversion/+bug/1163901/+subscriptions

Revision history for this message
Donald Walker (donaldw) wrote : Re: Ability to test apply an upgrade

I've created a branch in my local space called 'verify-feature'. It has a new command called 'verify' which does everything 'create' does, except actually commit. That should be ok for now. Motivation for a further 'simulate' option, is that some schema upgrades on our DB take up to fifteen minutes, and that's not something you'd want to run through only to rollback. That would obviously have a significant effect on a live environment.

Revision history for this message
Donald Walker (donaldw) wrote :

One thought for a future '--simulate' option - to some extent you always have to hit the DB anyway to check the current version etc. Fairly obvious, but I thought I'd point it out.

summary: - Ability to test apply an upgrade
+ Ability to 'verify' an upgrade ahead of attempting it
Revision history for this message
Adam Connelly (adam-rpconnelly) wrote :

Sorry it took me a few days to look into this. I wanted to run a quick sanity test before merging it in, but ironically I'd forgotten how to drop and create a database in Postgres since I haven't looked at this for a while.

That's it in now. Cheers.

Changed in dbversion:
status: In Progress → Fix Committed
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.