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

[run-postgresql] Make the DB initialization atomic #310

Closed
wants to merge 1 commit into from

Conversation

iankko
Copy link

@iankko iankko commented Feb 4, 2019

(complete all of its parts or retry it if some failed)

Might possibly fix: #309 (Didn't test it though)

Signed-off-by: Jan Lieskovsky jlieskov@redhat.com

(complete all of its parts or retry it if some failed)

Signed-off-by: Jan Lieskovsky <jlieskov@redhat.com>
@centos-ci
Copy link
Collaborator

Can one of the admins verify this patch?

4 similar comments
@centos-ci
Copy link
Collaborator

Can one of the admins verify this patch?

@centos-ci
Copy link
Collaborator

Can one of the admins verify this patch?

@rhscl-bot
Copy link

Can one of the admins verify this patch?

@rhscl-bot
Copy link

Can one of the admins verify this patch?

@praiskup
Copy link
Contributor

praiskup commented Feb 5, 2019

That variable is always false at that point.

@iankko
Copy link
Author

iankko commented Feb 5, 2019

Closing, this will need to be redone yet based on the discussion in the original issue.

@iankko iankko closed this Feb 5, 2019
@iankko
Copy link
Author

iankko commented Feb 5, 2019

Yet, re: That variable is always false at that point. - that was actually the intention. Always try to retry the DB init if the variable isn't set to something else than "false" yet. AFAICT this should be safe (if the DB entry already exists, calling next DB init won't touch it).

But the problem is, if not the whole DB initialization process finished before, the missing phases won't be retried in the 2nd run :(.

@praiskup
Copy link
Contributor

praiskup commented Feb 5, 2019

AFAICT this should be safe (if the DB entry already exists, calling next DB init won't touch it).

But re-initdb would fail, and that would fail the whole script/container run.

@iankko
Copy link
Author

iankko commented Feb 5, 2019

Right, good catch, you are right.

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.

PostgreSQL pod fails to restart properly if DB initialization didn't finish properly in previous pod run
4 participants