-
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: fix TestRandomSyntaxFunctions related bugs/flakes #107491
sql: fix TestRandomSyntaxFunctions related bugs/flakes #107491
Conversation
ad7607b
to
d42c484
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.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @fqazi)
pkg/sql/sem/builtins/builtins.go
line 5768 at r3 (raw file):
Fn: func(_ context.Context, _ *eval.Context, args tree.Datums) (d tree.Datum, err error) { defer func() { if r := recover(); r != nil {
i'm curious about this one - i think it's unexpected that the PrettyPrint
function would ever panic. how does that happen?
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! 0 of 0 LGTMs obtained (waiting on @rafiss)
pkg/sql/sem/builtins/builtins.go
line 5768 at r3 (raw file):
Previously, rafiss (Rafi Shamim) wrote…
i'm curious about this one - i think it's unexpected that the
PrettyPrint
function would ever panic. how does that happen?
@rafiss DecodeUntaggedUUIDValue and DecodeUntaggedIPAddrValue do not validate the input, so that they will hit out-of-bounds errors. The other approach is to update those code paths to generate errors. Not sure if there are performance considerations for those code paths
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! 0 of 0 LGTMs obtained (waiting on @fqazi)
pkg/sql/check.go
line 439 at r1 (raw file):
// If the context is cancelled, then we should bail out, since // the actual revalidate operation might not check anything. if err := ctx.Err(); err != nil {
i think sql-queries added this builtin so let's get them to sign off
pkg/sql/sem/builtins/builtins.go
line 5768 at r3 (raw file):
Previously, fqazi (Faizan Qazi) wrote…
@rafiss DecodeUntaggedUUIDValue and DecodeUntaggedIPAddrValue do not validate the input, so that they will hit out-of-bounds errors. The other approach is to update those code paths to generate errors. Not sure if there are performance considerations for those code paths
ah i see. i think we should actually do the recover
inside of the PrettyPrint
function, that way the error reporting is consistent with other kinds of errors that can happen in that function.
Previously, the function: revalidate_unique_constraints_in_all_tables did not properly check for cancellation when looping over all descriptors. This could just lead to a delayed cancellation or timeouts in tests. To address this, this patch updates the logic to check for cancellations while loop over descriptors. Fixes: cockroachdb#107410, cockroachdb#107411 Release note: None
Previously, when crdb_internal.pretty_value was added, we didn't handle cases where the decode functions can run into runtime errors. This can lead to out of bounds errors in certain cases. To address this, this patch makes this function safe by adding a recover call with the internally encountered error. Release note: None
d42c484
to
cc7e54e
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.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @rafiss)
pkg/sql/sem/builtins/builtins.go
line 5768 at r3 (raw file):
Previously, rafiss (Rafi Shamim) wrote…
ah i see. i think we should actually do the
recover
inside of thePrettyPrint
function, that way the error reporting is consistent with other kinds of errors that can happen in that function.
Done.
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.
Reviewed 1 of 1 files at r1, 2 of 2 files at r5, 1 of 1 files at r6, all commit messages.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @mgartner)
bors r+ |
bors r- |
Previously, the TestRandomSyntaxFunctions could invoke crdb_internal.gen_rand_ident with random arguments, which could be giant number of random identifiers. To address this, this patch will avoid validating this function. Release note: None
cc7e54e
to
72ac7ea
Compare
bors r+ |
Build succeeded: |
blathers backport 23.1 |
Encountered an error creating backports. Some common things that can go wrong:
You might need to create your backport manually using the backport tool. error creating merge commit from cf8fb9c to blathers/backport-release-23.1-107491: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict [] you may need to manually resolve merge conflicts with the backport tool. Backport to branch 23.1 failed. See errors above. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
Previously TestRandomSyntaxFunctions could flake due to the following bugs:
Fixes: #107410
Fixes: #107411