Skip to content
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

Drop databases before restore #1227

Merged
merged 1 commit into from
Dec 7, 2021
Merged

Drop databases before restore #1227

merged 1 commit into from
Dec 7, 2021

Conversation

mmorhun
Copy link
Contributor

@mmorhun mmorhun commented Dec 6, 2021

Signed-off-by: Mykola Morhun mmorhun@redhat.com

What does this PR do?

Drop databases before restore in order to be able to deploy clean Che in case of incompatible Postgres data formats.
Do not migrate objects related to backup.

Screenshot/screencast of this PR

N/A

What issues does this PR fix or reference?

eclipse-che/che#20812

How to test this PR?

PR Checklist

As the author of this Pull Request I made sure that:

Reviewers

Reviewers, please comment how you tested the PR when approving it.

controllers/checlusterrestore/backup_data_restorer.go Outdated Show resolved Hide resolved
for _, dbName := range databasesToDrop {
execReason := fmt.Sprintf("dropping %s database", dbName)
dropDatabaseCommand := fmt.Sprintf("psql -c \"DROP DATABASE %s;\"", dbName)
if output, err := k8sClient.DoExecIntoPod(rctx.namespace, postgresPodName, dropDatabaseCommand, execReason); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about returning `err ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, we shouldn't break the process. This step is only needed when database format is changed.

@tolusha tolusha mentioned this pull request Dec 6, 2021
28 tasks
@mmorhun mmorhun force-pushed the che-20812 branch 2 times, most recently from 7506977 to dc632d5 Compare December 6, 2021 15:17
@openshift-ci
Copy link

openshift-ci bot commented Dec 7, 2021

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: AndrienkoAleksandr, mmorhun, tolusha

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Signed-off-by: Mykola Morhun <mmorhun@redhat.com>
@openshift-ci
Copy link

openshift-ci bot commented Dec 7, 2021

New changes are detected. LGTM label has been removed.

@openshift-ci
Copy link

openshift-ci bot commented Dec 7, 2021

@mmorhun: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/v9-devworkspace-happy-path d9023d3 link true /test v9-devworkspace-happy-path

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@mmorhun mmorhun merged commit afa32e6 into main Dec 7, 2021
@mmorhun mmorhun deleted the che-20812 branch December 7, 2021 10:20
@che-bot che-bot added this to the 7.41 milestone Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants