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 manifest corruption #1756

Merged
merged 2 commits into from Nov 8, 2021

Conversation

iluminae
Copy link
Contributor

@iluminae iluminae commented Nov 2, 2021

This fixes the manifest corruption posted about here

I was able to reproduce the race condition every time by injecting a sleep into the sync call during tests only. I am not sure if you guys would rather have this or a test that is much longer and may or may not reproduce based on high concurrency (but does not inject the sleep) or no test at all.

Let me know - I made it so we can just revert the test commit and it should be good to go.


This change is Reviewable

@CLAassistant
Copy link

CLAassistant commented Nov 2, 2021

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@jarifibrahim jarifibrahim left a comment

Choose a reason for hiding this comment

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

Awesome find @iluminae! Thanks for fixing it.

manifest.go Show resolved Hide resolved
Copy link
Contributor

@NamanJain8 NamanJain8 left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 2 files reviewed, 2 unresolved discussions (waiting on @iluminae and @manishrjain)

a discussion (no related file):
:lgtm_strong:
Awesome @iluminae, this is a nice catch.
Thanks @jarifibrahim for the review. :)


@skrdgraph
Copy link
Contributor

fyi @billprovince @joshua-goldstein - +1 from me to get this in

joshua-goldstein pushed a commit that referenced this pull request Oct 18, 2022
…rrent compactions (#1756)

`manifestFile.rewrite` closes the file due to which `manifest.fp.Sync()` can fail. This leads to an updated manifest but non-updated tables set. Hence, the compaction process enters into an infinite loop failing with the `MANIFEST removes non-existing table` error.
This PR fixes it.

(cherry picked from commit 6ed45ae)
joshua-goldstein pushed a commit that referenced this pull request Nov 3, 2022
…rrent compactions (#1756)

`manifestFile.rewrite` closes the file due to which `manifest.fp.Sync()` can fail. This leads to an updated manifest but non-updated tables set. Hence, the compaction process enters into an infinite loop failing with the `MANIFEST removes non-existing table` error.
This PR fixes it.

(cherry picked from commit 6ed45ae)
joshua-goldstein pushed a commit that referenced this pull request Nov 3, 2022
…rrent compactions (#1756)

`manifestFile.rewrite` closes the file due to which `manifest.fp.Sync()` can fail. This leads to an updated manifest but non-updated tables set. Hence, the compaction process enters into an infinite loop failing with the `MANIFEST removes non-existing table` error.
This PR fixes it.

(cherry picked from commit 6ed45ae)
skrdgraph pushed a commit that referenced this pull request Nov 3, 2022
…rrent compactions (#1756) (#1820)

This PR is a cherry pick of #1756. Addresses [this
issue](https://discuss.dgraph.io/t/badgerdb-manifest-corruption-issue-solution/15915)
on Discuss and[ this
issue](#1819) on Badger.

Co-authored-by: Kenan Kessler <kesken88@gmail.com>
mYmNeo added a commit to mYmNeo/badger that referenced this pull request Feb 10, 2023
mYmNeo added a commit to mYmNeo/badger that referenced this pull request Feb 13, 2023
mangalaman93 pushed a commit that referenced this pull request Feb 14, 2023
…rrent compactions (#1756) (#1820)

This PR is a cherry pick of #1756. Addresses [this
issue](https://discuss.dgraph.io/t/badgerdb-manifest-corruption-issue-solution/15915)
on Discuss and[ this
issue](#1819) on Badger.

Co-authored-by: Kenan Kessler <kesken88@gmail.com>
skrdgraph pushed a commit to dgraph-io/dgraph that referenced this pull request Mar 7, 2023
Update Badger from `7677fcb` to `6ed45ae` (on main-deprecated branch).
This fixes dgraph-io/badger#1752 and
dgraph-io/badger#1756.

First CI failed
[here](https://github.com/dgraph-io/dgraph/actions/runs/4208376321/jobs/7304322951).
This issue was resolved by bumping up the Go version used in the
container.
fredcarle pushed a commit to fredcarle/badger that referenced this pull request Aug 1, 2023
…rrent compactions (dgraph-io#1756)

`manifestFile.rewrite` closes the file due to which `manifest.fp.Sync()` can fail. This leads to an updated manifest but non-updated tables set. Hence, the compaction process enters into an infinite loop failing with the `MANIFEST removes non-existing table` error.
This PR fixes it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants