-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
bulk: fix incorrect memory handling in the kvBuf #86738
Conversation
if b.curBuf.fits(ctx, need, sz(b.maxBufferLimit()), &b.memAcc) { | ||
return b.curBuf.append(key, value) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice find!
860c286
to
be9ce7e
Compare
This change fixes a memory accounting bug where we were appending a KV to the kvBuf without accounting for its memory. Release note (bug fix): adds a missing memory accounting call when appending a KV to the underlying kvBuf Release justification: low risk bug fix that prevents an import from panicking on non-release builds
be9ce7e
to
f3f5cc5
Compare
@@ -41,8 +41,8 @@ func TestAddBatched(t *testing.T) { | |||
t.Run("batch=default", func(t *testing.T) { | |||
runTestImport(t, 32<<20) | |||
}) | |||
t.Run("batch=1", func(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is no longer valid since a 1byte max buf size means we can't grow the kvBuf to be more than that, which means the single KV doesn't fit in that buffer.
TFTR! bors r=stevendanna |
Build succeeded: |
blathers backport 22.1 |
This change fixes a memory accounting bug where
we were appending a KV to the kvBuf without accounting
for its memory.
Release note (bug fix): adds a missing memory accounting
call when appending a KV to the underlying kvBuf
Release justification: low risk bug fix that prevents an
import from panicking on non-release builds