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

fix: tolerate corrupted COMMIT file #19

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

zmstone
Copy link
Member

@zmstone zmstone commented Nov 7, 2024

Observed COMMIT file corruption in a system which got IOPS limited.

The file is updated as follows

  1. write content to COMMIT.tmp
  2. rename COMMIT.tmp to COMMIT.

Due to unknown reason, COMMIT file can end up with empty content.

This PR ignores empty COMMIT file, also made the code to tolerate corrupted content.

@zmstone zmstone force-pushed the tolerate-corrupted-commit-file branch from a864316 to 6b9d176 Compare November 7, 2024 10:36
%% ignore empty file
%% sometimes (e.g. IOPS limited) do_commit (write to .tmp then rename) may fail
%% to write but succeed in rename.
%% ignoring COMMIT file leads to message receliver, so warning level
Copy link
Contributor

Choose a reason for hiding this comment

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

do you think it worth to check if COMMIT.tmp exists and use it?

Copy link
Member Author

Choose a reason for hiding this comment

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

don't think it worth the effort.

@zmstone zmstone merged commit f9cc922 into master Nov 7, 2024
4 checks passed
@zmstone zmstone deleted the tolerate-corrupted-commit-file branch November 7, 2024 11:03
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