-
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
sql: clear (rather than emptying) bound account #71280
Conversation
Empty() leaves some number of bytes in the bound account as reserved. When we abandon a Container, those "reserved" bytes were never released back to the parent. I believe we currently abandon one Container at the end of each explicit transaction. Release note: None
@@ -636,7 +636,7 @@ func (s *Container) freeLocked(ctx context.Context) { | |||
atomic.AddInt64(s.atomic.uniqueStmtFingerprintCount, int64(-len(s.mu.stmts))) | |||
atomic.AddInt64(s.atomic.uniqueTxnFingerprintCount, int64(-len(s.mu.txns))) | |||
|
|||
s.mu.acc.Empty(ctx) | |||
s.mu.acc.Clear(ctx) |
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.
wow. That's a good one.
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.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @miretskiy and @stevendanna)
Though I think #65279 is probably unrelated since it's from way back in May, the offending PR was merged last night |
Unfortunately, the way the reporting works, the new failure because of the memory pressure just got added as a comment to the previous issue. |
Ah, that was unfortunate 😢 |
bors r=[Azhng,miretskiy] |
Build succeeded: |
Empty() leaves some number of bytes in the bound account as
reserved. When we abandon a Container, those "reserved" bytes were
never released back to the parent. I believe we currently abandon one
Container at the end of each explicit transaction.
Fixes #71262
Fixes #71263
Fixes #71264
Fixes #65279
We may want to provide two different methods. One that calls Empty() and one that
calls Clear() in case there are users of this who really need to keep their reserved bytes.
Release note: None