-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Value log rewrites load the entire value log into memory #1292
Comments
Yes @Stebalien. That is correct. We should consider the size of the value when considering the size of the batch. The fix would be similar to the one in #1278 |
Running into OOM crashes during GC, is this related? I'm trying to use badger in a low memory environment with a large disk pprof heap screenshot, this rapidly consumes all available RAM and crashes. These are the seeing I am using:
|
@KlotzAndrew Yes, it is the same issue. I've bumped up the priority since multiple people are seeing the same failure. |
Hey @Stebalien @KlotzAndrew, I have a PR that should reduce the memory consumed by value log GC. Do you think you can test it #1357? I'll try to generate some data with large values and see if I can reproduce the high memory consumption. |
PR looks good to me. I'll need to complete the work to support badger 2 in go-ipfs to actually test it. |
The existing code doesn't consider the size of the value while calculating the size of the entry batch in rewrite method. This PR fixes it. Fixes #1292
The existing code doesn't consider the size of the value while calculating the size of the entry batch in rewrite method. This PR fixes it. Fixes #1292 (cherry picked from commit 14386ac) Co-authored-by: Ibrahim Jarif <[email protected]>
The existing code doesn't consider the size of the value while calculating the size of the entry batch in rewrite method. This PR fixes it. Fixes #1292
…o#1505) The existing code doesn't consider the size of the value while calculating the size of the entry batch in rewrite method. This PR fixes it. Fixes dgraph-io#1292 (cherry picked from commit 14386ac) Co-authored-by: Ibrahim Jarif <[email protected]>
What version of Go are you using (
go version
)?What version of Badger are you using?
1.6.1
Does this issue reproduce with the latest master?
I haven't tried but the code looks the same.
Description
When rewriting a value log (e.g., on garbage collection), badger will end up loading the entire value log into memory unless there are enough small values to exceed the batch count (ipfs/go-ds-badger#86).
When estimating the size of an entry:
badger/structs.go
Lines 153 to 158 in 8a93a41
Badger only estimates the size of the entry as it exists in the LSM.
When deciding whether or not to flush, badger only looks at this estimated size, not the size of the value itself:
badger/value.go
Lines 566 to 576 in 617ed7c
I believe the fix here is to look at the size of the value plus the LSM overhead, is that correct?
The text was updated successfully, but these errors were encountered: