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

Add cleanup step on failed chain snapshot restoration #267

Merged
merged 3 commits into from
Jul 6, 2023
Merged

Conversation

bakhtin
Copy link
Contributor

@bakhtin bakhtin commented Jul 4, 2023

Chain snapshot restoration script may fail leaving empty chain data directory on the disk.

On the first run of the script the chain data directory is created. If the script fails the directory remains empty while K8s will re-run failed init container. On the second execution the script will detect that chain data directory is present and will skip snapshot restoration even though it was not successful in the first try. The empty directory will then be mounted to the main node container and the chain will start syncing from scratch (possibly taking many days).

Add a trap command to do a cleanup (removing the chain directory) if any error occurs during the snapshot restoration process and avoid above situation from happening.

Copy link
Contributor

@BulatSaif BulatSaif left a comment

Choose a reason for hiding this comment

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

This script is executed on each restart we should make sure that trap will not remove working db

Signed-off-by: bakhtin <[email protected]>
Signed-off-by: bakhtin <[email protected]>
@bakhtin bakhtin requested a review from BulatSaif July 5, 2023 14:32
@bakhtin bakhtin merged commit 407eac7 into main Jul 6, 2023
@bakhtin bakhtin deleted the ab-its-a-trap branch July 6, 2023 11:02
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.

3 participants