-
Notifications
You must be signed in to change notification settings - Fork 270
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
ovirt-engine-setup database checks: being member of the database owner is also ok #842
Conversation
is also ok see oVirt#841 Signed-off-by: Felix Hamme <felix.hamme@ionos.com>
b410fc5
to
46f0419
Compare
Makes sense. Did you verify backup/restore? @emesika might want to review as well. |
@didib Backup and restore are tested successfully. |
lgtm, let's run ost |
/ost |
Sorry for being annoying. Did you test also the backup/restore done by engine-setup itself? It backs up the database at some point, and clears and restores it if there was a failure and it needs to rollback. To cause it to fail, you can simply press ^C at a strategic point - after backup, before finishing the transaction - or something like this:
|
These commands are tested:
Is this sufficient? |
It is, for testing engine-backup. But engine-setup has its own backup/restore code, which does not use engine-backup. |
To clarify: engine-setup has to backup, and potentially restore, only on upgrades - so that if the upgrade fails, you get back to your original state, before trying to upgrade. So you should first do a clean setup, then upgrade (can be to same version), and fail it in the middle of upgrade - after it backed up and before it committed. |
I can now also confirm a successful restore upon a failed upgrade (interrupted with ctrl+c). The engine worked after that.
|
LGTM, merging. Thanks! |
thanks for merging :) |
fixes issue #841
This PR makes the database check succeed also when some object is not owned by the user, but the user is member of some role which owns the object.
The
pg_catalog.pg_has_role
function is available since postgres 8.1 (released in 2005).The argument
'usage'
means that the user does not need to explicitly switch to the owner role usingSET ROLE
, which may be necessary with the alternative'member'
.