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

Initialize vlog before starting compactions in db.Open #1226

Merged
merged 2 commits into from
Feb 27, 2020

Conversation

jarifibrahim
Copy link
Contributor

@jarifibrahim jarifibrahim commented Feb 24, 2020

If compaction is started before opening vlog, badger might crash with
nil pointer error when trying to push discard stats at the end of
compactions because discard stats are initialized in vlog open.

Fixes #1209


This change is Reviewable

If compaction is started before opening vlog, badger might crash with
nil pointer error when trying to push discard stats at the end of
compactions because discard stats are initialized in vlog open.
@coveralls
Copy link

coveralls commented Feb 24, 2020

Coverage Status

Coverage decreased (-0.06%) to 69.679% when pulling 9cb401f on ibrahim/reorder-compaction into 78d405a on master.

@jarifibrahim jarifibrahim changed the title Open vlog before starting compactions in db.Open Initialize vlog before starting compactions in db.Open Feb 24, 2020
Copy link
Contributor

@martinmr martinmr left a comment

Choose a reason for hiding this comment

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

:lgtm: but get @manishrjain to take a look.

Reviewed 3 of 3 files at r2.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ashish-goswami and @manishrjain)

@jarifibrahim
Copy link
Contributor Author

@manishrjain has reviewed and approved this.

@jarifibrahim jarifibrahim merged commit 617ed7c into master Feb 27, 2020
@jarifibrahim jarifibrahim deleted the ibrahim/reorder-compaction branch February 27, 2020 16:47
jarifibrahim pushed a commit that referenced this pull request Mar 12, 2020
If compaction is started before opening vlog, badger might crash with
nil pointer error when trying to push discard stats at the end of
compactions because discard stats are initialized in vlog open.

This commit fixes it.

(cherry picked from commit 617ed7c)
jarifibrahim pushed a commit that referenced this pull request Mar 24, 2020
If compaction is started before opening vlog, badger might crash with
nil pointer error when trying to push discard stats at the end of
compactions because discard stats are initialized in vlog open.

This commit fixes it.

(cherry picked from commit 617ed7c)
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.

rarely, nil pointer panic in doCompact go-routine when a badger open.
3 participants