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

Make hash cache robust to crash and restart #5032

Merged
merged 6 commits into from
Feb 19, 2025

Conversation

HaoranYi
Copy link

@HaoranYi HaoranYi commented Feb 18, 2025

Problem

Hash cache is not robust for validator crash and restart. When a validator is
stopped or crashed in the middle of the writing the hash cache data, the
following restart will read incomplete cache file and fail.

Summary of Changes

Add ".in-progress" hash cache file when saving the data
Commit and rename the cache file only after we have completely written the data.

Fixes #

@HaoranYi HaoranYi changed the title make hash cache more robust to tolerate crash Make hash cache robust to tolerate crash and restart in the middle of cache file writes Feb 18, 2025
@HaoranYi HaoranYi changed the title Make hash cache robust to tolerate crash and restart in the middle of cache file writes Make hash cache robust to crash and restart Feb 18, 2025
Copy link

@brooksprumo brooksprumo left a comment

Choose a reason for hiding this comment

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

:shipit:

@HaoranYi HaoranYi merged commit 857a44b into anza-xyz:master Feb 19, 2025
47 checks passed
@HaoranYi HaoranYi deleted the cache_in_progress branch February 19, 2025 15:09
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.

2 participants