-
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: remove EvalContext.ActiveMemAcc #34935
Conversation
e248e2a
to
3bff9d1
Compare
3bff9d1
to
05cecf8
Compare
239aa4c
to
8019ace
Compare
8019ace
to
5b3785a
Compare
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.
LGTM with a nit on the message presented to the user, see suggestion below
Reviewed 18 of 18 files at r1.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @jordanlewis, @justinj, and @RaduBerinde)
pkg/sql/sem/builtins/builtins.go, line 72 at r1 (raw file):
errChrValueTooLarge = pgerror.NewErrorf(pgerror.CodeInvalidParameterValueError, "input value must be <= %d (maximum Unicode code point)", utf8.MaxRune) errStringTooLarge = pgerror.NewErrorf(pgerror.CodeProgramLimitExceededError, "requested length too large")
maybe NewErrorf(..., "result too large, value size exceeds %s", humanizeutil.IBytes(maxAllocatedStringsize)
this way the user knows more clearly what's going on.
I kept the message like that to achieve Postgres compatibility, but I'll take your advice. |
This memory account was used to track allocations performed by builtins that allocated memory, mainly string manipulation builtins. It was pretty hard to use this correctly, as the lifetimes of the account were never particularly clear. There were a couple of hacks in place to try to clear the memory at the right times, but they didn't work correctly, leading to crashes that were hard to diagnose. Rather than try to make this work perfectly, this commit removes the memory accounting for these builtins and replaces it with a hard cap on the size of string allocations - set arbitrarily to 64 MB at this time. Release note: None
5b3785a
to
2b00f15
Compare
bors r+ |
34935: sql: remove EvalContext.ActiveMemAcc r=jordanlewis a=jordanlewis This memory account was used to track allocations performed by builtins that allocated memory, mainly string manipulation builtins. It was pretty hard to use this correctly, as the lifetimes of the account were never particularly clear. There were a couple of hacks in place to try to clear the memory at the right times, but they didn't work correctly, leading to crashes that were hard to diagnose. Rather than try to make this work perfectly, this commit removes the memory accounting for these builtins and replaces it with a hard cap on the size of string allocations - set arbitrarily to 64 MB at this time. Release note: None 35074: opt: logical props and stats for merge join r=RaduBerinde a=RaduBerinde Wire up the code for logical props and stats to work with merge joins. This is useful with exprgen. Release note: None 35075: opt: add parallel test for create stats r=RaduBerinde a=RaduBerinde Adding a test where three nodes run CREATE STATS multiple times (in parallel) on the same table. Fixes #34781. Release note: None Co-authored-by: Jordan Lewis <[email protected]> Co-authored-by: Radu Berinde <[email protected]>
Build succeeded |
Add regression tests for a bug where backfilling a computed column or a column with a default value using a builtin function would cause a `memory budget exceeded` error (cockroachdb#34901). This was fixed by cockroachdb#34935. Release note: None
Add regression tests for a bug where backfilling a computed column or a column with a default value using a builtin function would cause a `memory budget exceeded` error (cockroachdb#34901). This was fixed by cockroachdb#34935. Release note: None
35565: sqlsmith: various improvements r=mjibson a=mjibson 35662: sql: add regression tests for memory accounting bug r=lucy-zhang a=lucy-zhang Add regression tests for a bug where backfilling a computed column or a column with a default value using a builtin function would cause a `memory budget exceeded` error (#34901). This was fixed by #34935. Release note: None Co-authored-by: Matt Jibson <[email protected]> Co-authored-by: Lucy Zhang <[email protected]>
This memory account was used to track allocations performed by builtins
that allocated memory, mainly string manipulation builtins. It was
pretty hard to use this correctly, as the lifetimes of the account were
never particularly clear.
There were a couple of hacks in place to try to clear the memory at the
right times, but they didn't work correctly, leading to crashes that
were hard to diagnose.
Rather than try to make this work perfectly, this commit removes the
memory accounting for these builtins and replaces it with a hard cap on
the size of string allocations - set arbitrarily to 64 MB at this time.
Release note: None