-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add pg_dump support back to PostgresAdmin #351
Add pg_dump support back to PostgresAdmin #351
Conversation
Removed as part of: ManageIQ#302 In commit 271febd ManageIQ@271febd3 Also adds some tests for future confirmation that other additions and refactoring will not brake what is already here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pg_dump
should not be an option for backup.
The resolution for https://bugzilla.redhat.com/show_bug.cgi?id=1535345 should utilize pg_basebackup
Ah this is for support, not for backup. We should just ensure that this is clear, maybe add a warning in the console.
5d55466
to
553ab41
Compare
Handles combining opts/args for runcmd with the default_args used by every PG command.
There are a few args passable to `pg_dump` that can take multiple values. Since it is safer (in my eyes) to do `-t table1 -t table2` instead of trying our luck with `-t table1 table2`, this change makes it so the options passed to AwesomeSpawn do the former and not the latter. To accomplish this, this means we have to move the arguments outside of the `opts` hash, and into the `args` array. Also added a pretty decent amount of tests around this to make sure it works as expected.
553ab41
to
156e1ec
Compare
Checked commits NickLaMuro/manageiq-gems-pending@9dcbe55~...156e1ec with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 spec/util/postgres_admin_spec.rb
|
@carbonin Seeing as the requirement is now clearly defined for https://bugzilla.redhat.com/show_bug.cgi?id=1535345#c20 , and the request is to use a |
So as to your first question:
I think that we should keep them as separate methods, especially given the confusion I want to avoid around backup vs. dump. |
@NickLaMuro are we shooting for table exclusions on the first pass? The comment in the BZ made that seem more like a "nice to have". I'm okay leaving it in here either way. I think the challenging part will be making the console UX make sense so we can probably make that decision in that PR. What do you think? |
Cool, works for me.
Well, first pass as in "the resulting work for this sprint", then yes, only because I don't see it as being much more work. I am probably going to split it up PR wise though, so it will probably look something like this for you:
I also see (down the road) making some PRs to add FTP support to these actions and the rake tasks, but that is part of the additional RFE as talked about in the BZ.
Agreed, though I think we have some facilities already in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me @NickLaMuro
Adds
PostgresAdmin.backup_pg_dump
, which mostly undoes the changes in 271febd3 (from #302 ).In addition:
PostgresAdmin.combine_command_args
PostgresAdmin.runcmd
PostgresAdmin.backup_pg_dump
to use.combine_command_args
and a new method.handle_multi_value_pg_dump_args!
to handle arguments forpg_dump
that can have multiple values, and passes them toAwesomeSpawn
in a manner thatpg_dump
should be happy with.The end result is that
.backup_pg_dump
will call toruncmd_with_logging
directly instead ofruncmd
, but that is just a implementation detail.Remaining questions
PostgresAdmin.backup
default toPostgresAdmin.backup_pg_compress
by default, but if it gets any-t
or--table
type args, usepg_dump
instead? (I am indifferent, but we are kind of doing this already withrestore
, so I figured I would ask)appliance_console
to differentiate betweenDatabase Backup
andDatabase Dump
?Links