-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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/stats: stats forecasting can't handle NaN values #113645
Labels
branch-master
Failures and bugs on the master branch.
branch-release-22.2
Used to mark GA and release blockers, technical advisories, and bugs for 22.2
branch-release-23.1
Used to mark GA and release blockers, technical advisories, and bugs for 23.1
branch-release-23.2
Used to mark GA and release blockers, technical advisories, and bugs for 23.2
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
release-blocker
Indicates a release-blocker. Use with branch-release-2x.x label to denote which branch is blocked.
T-sql-queries
SQL Queries Team
Comments
There are likely similar problems with +/-inf as well. |
DrewKimball
added a commit
to DrewKimball/cockroach
that referenced
this issue
Nov 2, 2023
This patch adds a method to the quantile function, `invalid`, which checks for `NaN` values within the function. These indicate a failure to derive a linear regression model for the observed histograms, and can lead to internal errors and panics if not caught. Stats forecasting now checks this method before attempting to use a quantile function to derive a histogram prediction. Fixes cockroachdb#113645 Fixes cockroachdb#113680 Release note (bug fix): Fixed a bug that could cause internal errors or panics while attempting to forecast statistics on a numeric column.
DrewKimball
added a commit
to DrewKimball/cockroach
that referenced
this issue
Nov 2, 2023
This patch adds a method to the quantile function, `invalid`, which checks for `NaN` and `+/-Inf` values within the function. These indicate a failure to derive a linear regression model for the observed histograms, and can lead to internal errors and panics if not caught. Stats forecasting now checks this method before attempting to use a quantile function to derive a histogram prediction. This patch also reverts 120132e, since `fixMalformed` is no longer expected to return an error. Fixes cockroachdb#113645 Fixes cockroachdb#113680 Release note (bug fix): Fixed a bug that could cause internal errors or panics while attempting to forecast statistics on a numeric column.
DrewKimball
added a commit
to DrewKimball/cockroach
that referenced
this issue
Nov 3, 2023
This patch adds panic-catching logic to `GetTableStats`, so that "safe" panics (out-of-bounds, assertion etc.) can be propagated as a returned error. This allows some code-paths to ignore the returned error, so that execution can proceed even there's an unexpected error in the stats code. This prevents situations where it becomes impossible to query a table because of a stats bug. Informs cockroachdb#113645 Release note: None
craig bot
pushed a commit
that referenced
this issue
Nov 3, 2023
113712: sql/stats: don't use linear regression with NaN for stats forecasting r=DrewKimball a=DrewKimball This patch adds a method to the quantile function, `invalid`, which checks for `NaN` values within the function. These indicate a failure to derive a linear regression model for the observed histograms, and can lead to internal errors and panics if not caught. Stats forecasting now checks this method before attempting to use a quantile function to derive a histogram prediction. Fixes #113645 Fixes #113680 Release note (bug fix): Fixed a bug that could cause internal errors or panics while attempting to forecast statistics on a numeric column. Co-authored-by: Drew Kimball <[email protected]>
blathers-crl bot
pushed a commit
that referenced
this issue
Nov 3, 2023
This patch adds a method to the quantile function, `invalid`, which checks for `NaN` and `+/-Inf` values within the function. These indicate a failure to derive a linear regression model for the observed histograms, and can lead to internal errors and panics if not caught. Stats forecasting now checks this method before attempting to use a quantile function to derive a histogram prediction. This patch also reverts 120132e, since `fixMalformed` is no longer expected to return an error. Fixes #113645 Fixes #113680 Release note (bug fix): Fixed a bug that could cause internal errors or panics while attempting to forecast statistics on a numeric column.
blathers-crl bot
pushed a commit
that referenced
this issue
Nov 3, 2023
This patch adds panic-catching logic to `GetTableStats`, so that "safe" panics (out-of-bounds, assertion etc.) can be propagated as a returned error. This allows some code-paths to ignore the returned error, so that execution can proceed even there's an unexpected error in the stats code. This prevents situations where it becomes impossible to query a table because of a stats bug. Informs #113645 Release note: None
DrewKimball
added a commit
to DrewKimball/cockroach
that referenced
this issue
Nov 3, 2023
This patch adds a method to the quantile function, `invalid`, which checks for `NaN` and `+/-Inf` values within the function. These indicate a failure to derive a linear regression model for the observed histograms, and can lead to internal errors and panics if not caught. Stats forecasting now checks this method before attempting to use a quantile function to derive a histogram prediction. This patch also reverts 120132e, since `fixMalformed` is no longer expected to return an error. Fixes cockroachdb#113645 Fixes cockroachdb#113680 Release note (bug fix): Fixed a bug that could cause internal errors or panics while attempting to forecast statistics on a numeric column.
DrewKimball
added a commit
to DrewKimball/cockroach
that referenced
this issue
Nov 3, 2023
This patch adds panic-catching logic to `GetTableStats`, so that "safe" panics (out-of-bounds, assertion etc.) can be propagated as a returned error. This allows some code-paths to ignore the returned error, so that execution can proceed even there's an unexpected error in the stats code. This prevents situations where it becomes impossible to query a table because of a stats bug. Informs cockroachdb#113645 Release note: None
DrewKimball
added a commit
to DrewKimball/cockroach
that referenced
this issue
Nov 3, 2023
This patch adds a method to the quantile function, `invalid`, which checks for `NaN` and `+/-Inf` values within the function. These indicate a failure to derive a linear regression model for the observed histograms, and can lead to internal errors and panics if not caught. Stats forecasting now checks this method before attempting to use a quantile function to derive a histogram prediction. This patch also reverts 120132e, since `fixMalformed` is no longer expected to return an error. Fixes cockroachdb#113645 Fixes cockroachdb#113680 Release note (bug fix): Fixed a bug that could cause internal errors or panics while attempting to forecast statistics on a numeric column.
DrewKimball
added a commit
to DrewKimball/cockroach
that referenced
this issue
Nov 4, 2023
This patch adds a method to the quantile function, `invalid`, which checks for `NaN` and `+/-Inf` values within the function. These indicate a failure to derive a linear regression model for the observed histograms, and can lead to internal errors and panics if not caught. Stats forecasting now checks this method before attempting to use a quantile function to derive a histogram prediction. This patch also reverts 120132e, since `fixMalformed` is no longer expected to return an error. Fixes cockroachdb#113645 Fixes cockroachdb#113680 Release note (bug fix): Fixed a bug that could cause internal errors or panics while attempting to forecast statistics on a numeric column.
DrewKimball
added a commit
to DrewKimball/cockroach
that referenced
this issue
Nov 4, 2023
This patch adds panic-catching logic to `GetTableStats`, so that "safe" panics (out-of-bounds, assertion etc.) can be propagated as a returned error. This allows some code-paths to ignore the returned error, so that execution can proceed even there's an unexpected error in the stats code. This prevents situations where it becomes impossible to query a table because of a stats bug. Informs cockroachdb#113645 Release note: None
blathers-crl bot
pushed a commit
that referenced
this issue
Nov 6, 2023
This patch adds a method to the quantile function, `invalid`, which checks for `NaN` and `+/-Inf` values within the function. These indicate a failure to derive a linear regression model for the observed histograms, and can lead to internal errors and panics if not caught. Stats forecasting now checks this method before attempting to use a quantile function to derive a histogram prediction. This patch also reverts 120132e, since `fixMalformed` is no longer expected to return an error. Fixes #113645 Fixes #113680 Release note (bug fix): Fixed a bug that could cause internal errors or panics while attempting to forecast statistics on a numeric column.
blathers-crl bot
pushed a commit
that referenced
this issue
Nov 6, 2023
This patch adds panic-catching logic to `GetTableStats`, so that "safe" panics (out-of-bounds, assertion etc.) can be propagated as a returned error. This allows some code-paths to ignore the returned error, so that execution can proceed even there's an unexpected error in the stats code. This prevents situations where it becomes impossible to query a table because of a stats bug. Informs #113645 Release note: None
DrewKimball
added a commit
to DrewKimball/cockroach
that referenced
this issue
Nov 6, 2023
This patch adds a method to the quantile function, `invalid`, which checks for `NaN` and `+/-Inf` values within the function. These indicate a failure to derive a linear regression model for the observed histograms, and can lead to internal errors and panics if not caught. Stats forecasting now checks this method before attempting to use a quantile function to derive a histogram prediction. This patch also reverts 120132e, since `fixMalformed` is no longer expected to return an error. Fixes cockroachdb#113645 Fixes cockroachdb#113680 Release note (bug fix): Fixed a bug that could cause internal errors or panics while attempting to forecast statistics on a numeric column.
DrewKimball
added a commit
to DrewKimball/cockroach
that referenced
this issue
Nov 6, 2023
This patch adds panic-catching logic to `GetTableStats`, so that "safe" panics (out-of-bounds, assertion etc.) can be propagated as a returned error. This allows some code-paths to ignore the returned error, so that execution can proceed even there's an unexpected error in the stats code. This prevents situations where it becomes impossible to query a table because of a stats bug. Informs cockroachdb#113645 Release note: None
DrewKimball
added a commit
to DrewKimball/cockroach
that referenced
this issue
Nov 6, 2023
This patch adds panic-catching logic to `GetTableStats`, so that "safe" panics (out-of-bounds, assertion etc.) can be propagated as a returned error. This allows some code-paths to ignore the returned error, so that execution can proceed even there's an unexpected error in the stats code. This prevents situations where it becomes impossible to query a table because of a stats bug. Informs cockroachdb#113645 Release note: None
DrewKimball
added a commit
to DrewKimball/cockroach
that referenced
this issue
Nov 6, 2023
This patch adds panic-catching logic to `GetTableStats`, so that "safe" panics (out-of-bounds, assertion etc.) can be propagated as a returned error. This allows some code-paths to ignore the returned error, so that execution can proceed even there's an unexpected error in the stats code. This prevents situations where it becomes impossible to query a table because of a stats bug. Informs cockroachdb#113645 Release note: None
@DrewKimball Is there a work-around for this issue, like disabling forecasting? |
We talked IRL. The workaround is to disable stats forecasting with either:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
branch-master
Failures and bugs on the master branch.
branch-release-22.2
Used to mark GA and release blockers, technical advisories, and bugs for 22.2
branch-release-23.1
Used to mark GA and release blockers, technical advisories, and bugs for 23.1
branch-release-23.2
Used to mark GA and release blockers, technical advisories, and bugs for 23.2
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
release-blocker
Indicates a release-blocker. Use with branch-release-2x.x label to denote which branch is blocked.
T-sql-queries
SQL Queries Team
It is possible for the calculations involved with stats forecasting to result in
NaN
values, whether because histogram bounds areNaN
or because of extreme values like the max float64 value. Currently, the quantile logic is unable to handle this. It is possible to trigger the error added in #109461 using the following test:as well as a related out-of-bounds error on a separate line with a slightly different test:
Jira issue: CRDB-33086
The text was updated successfully, but these errors were encountered: