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

Badger writes get blocked (maybe stalled) #1283

Closed
jarifibrahim opened this issue Mar 30, 2020 · 2 comments
Closed

Badger writes get blocked (maybe stalled) #1283

jarifibrahim opened this issue Mar 30, 2020 · 2 comments
Assignees
Labels
kind/bug Something is broken. priority/P0 Critical issue that requires immediate attention. status/accepted We accept to investigate or work on it.

Comments

@jarifibrahim
Copy link
Contributor

jarifibrahim commented Mar 30, 2020

What version of Go are you using (go version)?

$ go version
go 1.13

What version of Badger are you using?

v2.0.0

Does this issue reproduce with the latest master?

NO

What did you do?

Run the script https://gist.github.com/jarifibrahim/5ec4983a308e67f116c4ca223344f134#file-main-go

What did you expect to see?

Writes working.

What did you see instead?

The writes were blocked. As seen here https://gist.github.com/jarifibrahim/5ec4983a308e67f116c4ca223344f134#file-output-txt no writes were done for more than an hour.

@jarifibrahim jarifibrahim added kind/bug Something is broken. priority/P0 Critical issue that requires immediate attention. status/accepted We accept to investigate or work on it. labels Mar 30, 2020
@jarifibrahim jarifibrahim self-assigned this Mar 30, 2020
@jarifibrahim
Copy link
Contributor Author

The issue seems to be because of value log GC. I noticed that the GC gets blocked and so the writes are also blocked. Commenting out this line https://gist.github.com/jarifibrahim/5ec4983a308e67f116c4ca223344f134#file-main-go-L88 seems to unblock the writes.

@jarifibrahim
Copy link
Contributor Author

The script https://gist.github.com/jarifibrahim/5ec4983a308e67f116c4ca223344f134 gets blocked until value log GC is completed. In Badger v2.0.0 we had issue with the cache because of which all bloom filters were being read from the file. Reading bloom filters from the file is very slow and expensive in terms of CPU and disk. This issue was fixed via #1260 .

The newer versions of badger have a separate cache for bloom filters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something is broken. priority/P0 Critical issue that requires immediate attention. status/accepted We accept to investigate or work on it.
Development

No branches or pull requests

1 participant