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 fsync after creating new manifest #351

Merged
merged 2 commits into from
Mar 5, 2021

Conversation

manish-sethi
Copy link
Contributor

This simple PR adds an fsync call on the manifest file when a new
manifest file is generated at the start.

In absence of this, the code updates the "CURRENT" and deletes the
previous manifest file and a crash at this point could leave the latest
manifest with a single incomplete record. With this content in the manifest file,
a restart is expected to lead to manifest corrupt error
This seems to explain the error observed in issue #335. We too have observed this error in our environment.

closes #335.

@manish-sethi
Copy link
Contributor Author

@syndtr - can you have a look/merge at this PR.

This commit
- Upgrades go versions. Build fails for prior versions as they
do not use go modules
- Disables go vet for the "tip" till the issues are fixed for latest go version

Signed-off-by: manish <manish.sethi@gmail.com>
This simple PR adds an fsync call on the manifest file when a new
manifest file is generated at the start.

In absence of this, the code updates the "CURRENT" and deletes the
previous manifest file and a crash at this point could leave the latest
manifest with a single incomplete record. Under this situation,
a restart is expected to lead to [manifest corrupt error](https://github.com/syndtr/goleveldb/blob/5c35d600f0caac04c20d52438103f1a7aa612598/leveldb/session.go#L192)
This seems to explain the error observed in issue#335. We too have observed this error in our environment.
@syndtr syndtr merged commit 64b5b1c into syndtr:master Mar 5, 2021
@manish-sethi manish-sethi deleted the fsync_new_manifest branch March 5, 2021 18:17
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.

manifets corrupted (filed 'comparer')
2 participants