Skip to content
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

roachtest: unoptimized-query-oracle/disable-rules=all failed #87605

Closed
cockroach-teamcity opened this issue Sep 8, 2022 · 5 comments · Fixed by #87808
Closed

roachtest: unoptimized-query-oracle/disable-rules=all failed #87605

cockroach-teamcity opened this issue Sep 8, 2022 · 5 comments · Fixed by #87808
Assignees
Labels
branch-release-22.2 Used to mark release blockers and technical advisories for 22.2 C-test-failure Broken test (automatically or manually discovered). O-roachtest O-robot Originated from a bot. T-sql-queries SQL Queries Team
Projects
Milestone

Comments

@cockroach-teamcity
Copy link
Member

cockroach-teamcity commented Sep 8, 2022

roachtest.unoptimized-query-oracle/disable-rules=all failed with artifacts on release-22.2 @ f8e04f32b84a9727c9e813d0096bde2de64d5675:

test artifacts and logs in: /artifacts/unoptimized-query-oracle/disable-rules=all/run_1
	query_comparison_util.go:240,query_comparison_util.go:69,unoptimized_query_oracle.go:51,test_runner.go:908: . 9271 statements run: expected unoptimized and optimized results to be equal
		(1) attached stack trace
		  -- stack trace:
		  | github.com/cockroachdb/cockroach/pkg/cmd/roachtest/tests.(*queryComparisonHelper).makeError
		  | 	github.com/cockroachdb/cockroach/pkg/cmd/roachtest/tests/query_comparison_util.go:348
		  | [...repeated from below...]
		Wraps: (2) . 9271 statements run
		Wraps: (3) attached stack trace
		  -- stack trace:
		  | github.com/cockroachdb/cockroach/pkg/cmd/roachtest/tests.runUnoptimizedQueryOracleImpl
		  | 	github.com/cockroachdb/cockroach/pkg/cmd/roachtest/tests/unoptimized_query_oracle.go:165
		  | github.com/cockroachdb/cockroach/pkg/cmd/roachtest/tests.registerUnoptimizedQueryOracle.func1.1
		  | 	github.com/cockroachdb/cockroach/pkg/cmd/roachtest/tests/unoptimized_query_oracle.go:54
		  | github.com/cockroachdb/cockroach/pkg/cmd/roachtest/tests.runOneRoundQueryComparison
		  | 	github.com/cockroachdb/cockroach/pkg/cmd/roachtest/tests/query_comparison_util.go:239
		  | github.com/cockroachdb/cockroach/pkg/cmd/roachtest/tests.runQueryComparison
		  | 	github.com/cockroachdb/cockroach/pkg/cmd/roachtest/tests/query_comparison_util.go:69
		  | github.com/cockroachdb/cockroach/pkg/cmd/roachtest/tests.registerUnoptimizedQueryOracle.func1
		  | 	github.com/cockroachdb/cockroach/pkg/cmd/roachtest/tests/unoptimized_query_oracle.go:51
		  | main.(*testRunner).runTest.func2
		  | 	main/pkg/cmd/roachtest/test_runner.go:908
		  | runtime.goexit
		  | 	GOROOT/src/runtime/asm_amd64.s:1594
		Wraps: (4) expected unoptimized and optimized results to be equal
		  |   []string{
		  |   	"000000000000,NULL,0,0,NULL",
		  |   	"000000000000,NULL,0,0,NULL",
		  |   	"000000000000,f2147dbd-ac48-465b-9e72-b07afa3c2eb4,0,0,NULL",
		  |   	strings.Join({
		  |   		"000000000000,feeffeef-feef-feef-feef-feeffeeffeef,0,0,1.23456789",
		  |   		"01234",
		  | + 		"56",
		  |   		"e+13",
		  |   	}, ""),
		  |   }
		  | sql: SELECT
		  | 	B'000000000000' AS col_31904,
		  | 	tab_11254.col2_10 AS col_31905,
		  | 	0:::OID AS col_31906,
		  | 	0:::OID AS col_31907,
		  | 	(tab_11254.col2_7::FLOAT8 // 1.0:::FLOAT8::FLOAT8)::FLOAT8 AS col_31908
		  | FROM
		  | 	defaultdb.public.table2@[0] AS tab_11254
		  | ORDER BY
		  | 	tab_11254.col2_2 ASC, tab_11254.col2_8 ASC
		Error types: (1) *withstack.withStack (2) *errutil.withPrefix (3) *withstack.withStack (4) *errutil.leafError

Parameters: ROACHTEST_cloud=gce , ROACHTEST_cpu=4 , ROACHTEST_ssd=0

Help

See: roachtest README

See: How To Investigate (internal)

Same failure on other branches

/cc @cockroachdb/sql-queries

This test on roachdash | Improve this report!

Jira issue: CRDB-19442

@cockroach-teamcity cockroach-teamcity added branch-release-22.2 Used to mark release blockers and technical advisories for 22.2 C-test-failure Broken test (automatically or manually discovered). O-roachtest O-robot Originated from a bot. release-blocker Indicates a release-blocker. Use with branch-release-2x.x label to denote which branch is blocked. labels Sep 8, 2022
@cockroach-teamcity cockroach-teamcity added this to the 22.2 milestone Sep 8, 2022
@cockroach-teamcity cockroach-teamcity added this to Triage in SQL Queries Sep 8, 2022
@blathers-crl blathers-crl bot added the T-sql-queries SQL Queries Team label Sep 8, 2022
@msirek
Copy link
Contributor

msirek commented Sep 9, 2022

Another occurrence of the precision problem.

@msirek
Copy link
Contributor

msirek commented Sep 9, 2022

simplified test case:

drop table if exists table2;
CREATE TABLE table2 (
      col2_2 INT NOT NULL,
      col2_7 FLOAT8 NULL,
      col2_8 INT NULL
  );

insert into table2 values(1, NULL, 0);
insert into table2 values(2, 1.234567890123456e+13, NULL);
insert into table2 values(3, NULL, NULL);
insert into table2 values(4, NULL, NULL);


SET testing_optimizer_random_seed = 6104496969551903372;

SET testing_optimizer_disable_rule_probability = 1.000000;

SET vectorize = off;

SELECT
        (tab_11254.col2_7::FLOAT8 // 1.0:::FLOAT8::FLOAT8)::FLOAT8 AS col_31908
FROM
        table2@[0] AS tab_11254
ORDER BY
        tab_11254.col2_2 ASC, tab_11254.col2_8 ASC;
       col_31908
-----------------------
                 NULL
  1.2345678901234e+13
                 NULL
                 NULL

RESET testing_optimizer_random_seed;

RESET testing_optimizer_disable_rule_probability;

SELECT
        (tab_11254.col2_7::FLOAT8 // 1.0:::FLOAT8::FLOAT8)::FLOAT8 AS col_31908
FROM
        table2@[0] AS tab_11254
ORDER BY
        tab_11254.col2_2 ASC, tab_11254.col2_8 ASC;
        col_31908
-------------------------
                   NULL
  1.234567890123456e+13
                   NULL
                   NULL

@msirek
Copy link
Contributor

msirek commented Sep 12, 2022

This is an issue with inappropriate removal of the // operator, floor division.

The correct answer for ((1.234567890123456e+13::FLOAT8 // 1.0:::FLOAT8::FLOAT8)::FLOAT8) should be 1.2345678901234e+13.
In the bad plan the floor division is removed.

@cockroach-teamcity
Copy link
Member Author

roachtest.unoptimized-query-oracle/disable-rules=all failed with artifacts on release-22.2 @ 9b62adaceb821a96d325a8ce30f35952ec48e9e5:

		  | [...repeated from below...]
		Wraps: (2) . 19897 statements run
		Wraps: (3) attached stack trace
		  -- stack trace:
		  | github.com/cockroachdb/cockroach/pkg/cmd/roachtest/tests.runUnoptimizedQueryOracleImpl
		  | 	github.com/cockroachdb/cockroach/pkg/cmd/roachtest/tests/unoptimized_query_oracle.go:165
		  | github.com/cockroachdb/cockroach/pkg/cmd/roachtest/tests.registerUnoptimizedQueryOracle.func1.1
		  | 	github.com/cockroachdb/cockroach/pkg/cmd/roachtest/tests/unoptimized_query_oracle.go:54
		  | github.com/cockroachdb/cockroach/pkg/cmd/roachtest/tests.runOneRoundQueryComparison
		  | 	github.com/cockroachdb/cockroach/pkg/cmd/roachtest/tests/query_comparison_util.go:239
		  | github.com/cockroachdb/cockroach/pkg/cmd/roachtest/tests.runQueryComparison
		  | 	github.com/cockroachdb/cockroach/pkg/cmd/roachtest/tests/query_comparison_util.go:69
		  | github.com/cockroachdb/cockroach/pkg/cmd/roachtest/tests.registerUnoptimizedQueryOracle.func1
		  | 	github.com/cockroachdb/cockroach/pkg/cmd/roachtest/tests/unoptimized_query_oracle.go:51
		  | main.(*testRunner).runTest.func2
		  | 	main/pkg/cmd/roachtest/test_runner.go:908
		  | runtime.goexit
		  | 	GOROOT/src/runtime/asm_amd64.s:1594
		Wraps: (4) expected unoptimized and optimized results to be equal
		  |   []string{
		  |   	strings.Join({
		  |   		"&,0000-01-01 08:20:00 -1500 -1500,0,15,$,1662993581051832774",
		  | + 		".0000000000",
		  |   		",0,NULL,e5fe:5c7b:210f:d985:dc75:1a37:50c4:ae98/122,010100000000",
		  |   		"0000000000F03F000000000000F03F,0",
		  |   	}, ""),
		  |   	strings.Join({
		  |   		"&,0000-01-01 08:20:00 -1500 -1500,0,15,$,1662993582729701327",
		  | + 		".0000000000",
		  |   		",0,NULL,e5fe:5c7b:210f:d985:dc75:1a37:50c4:ae98/122,010100004066",
		  |   		"939A999026F941B067FCD8AFBEEA4160B889AF6A33CF41,0",
		  |   	}, ""),
		  |   }
		  | sql: SELECT
		  | 	'&':::STRING AS col_82413,
		  | 	'08:20:00-15:00:00':::TIMETZ AS col_82414,
		  | 	0:::OID AS col_82415,
		  | 	15:::INT8 AS col_82416,
		  | 	'$':::STRING AS col_82417,
		  | 	(tab_25356.crdb_internal_mvcc_timestamp::DECIMAL // 1:::DECIMAL::DECIMAL)::DECIMAL AS col_82418,
		  | 	0:::OID AS col_82419,
		  | 	tab_25356.col1_9 AS col_82420,
		  | 	'e5fe:5c7b:210f:d985:dc75:1a37:50c4:ae98/122':::INET AS col_82421,
		  | 	tab_25356.col1_0 AS col_82422,
		  | 	0:::OID AS col_82423
		  | FROM
		  | 	defaultdb.public.table1@[0] AS tab_25356
		  | ORDER BY
		  | 	tab_25356.col1_15 DESC, tab_25356.col1_8, tab_25356.col1_8, tab_25356.col1_17 DESC
		Error types: (1) *withstack.withStack (2) *errutil.withPrefix (3) *withstack.withStack (4) *errutil.leafError

Parameters: ROACHTEST_cloud=gce , ROACHTEST_cpu=4 , ROACHTEST_ssd=0

Help

See: roachtest README

See: How To Investigate (internal)

Same failure on other branches

This test on roachdash | Improve this report!

@mgartner mgartner removed the release-blocker Indicates a release-blocker. Use with branch-release-2x.x label to denote which branch is blocked. label Sep 12, 2022
@mgartner
Copy link
Collaborator

Closing as a duplicate of #86790.

SQL Queries automation moved this from Triage to Done Sep 12, 2022
craig bot pushed a commit that referenced this issue Sep 22, 2022
87808: norm: do not fold floor division with unit denominator r=msirek a=msirek

Fixes #87605

The floor division operator `//` is like division but drops the
fractional portion of the result. Normalization rule FoldDivOne
rewrites `(column // 1)` as `(column)` which is incorrect if the
data in `column` has fractional digits, as those digits should be
dropped.

The solution is to only fold `(column // 1)` when `column` is one of
the integer types.

Release note (bug fix): This patch fixes incorrect results from
the floor division operator, `//`, when the numerator is non-constant
and the denominator is the constant 1.

88082: *: audit operation names in new schema changer r=Xiang-Gu a=Xiang-Gu

This PR made non-functional changes related to new schema changer ops:
1. Rename all status changing operation on Index and Column to comform
to the pattern: `Make[StatusA][Index/Column][StatusB]`

2. Rename a few constant/field/function names to be consistent with the
principle of "being explicit":
  2.1. Rename operation name `XxxGcXxx` to `XxxGCXxx`;
  2.2. Rename field name in operations `DescID` to `DescriptorID`;
  2.3. Rename descpb.DELETE_AND_WRITE_ONLY to descpb.WRITE_ONLY;
  2.4. Rename sql.RunningStatusDeleteAndWriteOnly to sql.RunningStatusWriteOnly

3. Seveal comments enhencement

4. Rename `DELETE_AND_WRITE_ONLY` to `WRITE_ONLY` in some files under
docs/.

Fixes #84583

Release note: None

88459: kv: fix spelling of "interceptor" in file name r=nvanbenschoten a=nvanbenschoten

All other file names and code objects have the correct spelling.

Release justification: None.

Release note: None.

88468: kvserver/batcheval: ignore UseRangeTombstonesForPointDeletes knob sometimes r=ajwerner a=ajwerner

We want to ignore the point deletion knob for cases where we're deleting data from system tables watched by rangefeeds. Not doing so can lead to missed updates. This is particularly critical for cluster settings.

Fixes #87575
Fixes #87479
Fixes #88202

Release note: None

88475: workload/schemachange/mixed-version: avoid index visibility r=fqazi a=fqazi

Fixes: #87768

Previously, we were generating statements with invisible indexes in mixed version environments, which could lead to statements generated not supported on older versions. To address this, this patch will prevent the generation of create table/ create index statements with invisible indexes.

Release note: None

88476: multitenant: add TestTenants() helper to TestServer r=ajstorm a=msbutler

This patch adds a helper method for accessing information about the tenant(s) that were probabilistically created with the TestServer.

Release note: None

88478: cli/sql: increase maxHistEntries r=ajwerner a=knz

As discussed this morning.

In light of PR #88272, we don't need the limit to be as low as 1000. This commit increases it back to 10000, which is the common default in unix shells and the screen/tmux utilities.


Co-authored-by: Mark Sirek <sirek@cockroachlabs.com>
Co-authored-by: Xiang Gu <xiang@cockroachlabs.com>
Co-authored-by: Nathan VanBenschoten <nvanbenschoten@gmail.com>
Co-authored-by: Andrew Werner <awerner32@gmail.com>
Co-authored-by: Faizan Qazi <faizan@cockroachlabs.com>
Co-authored-by: Michael Butler <butler@cockroachlabs.com>
Co-authored-by: Raphael 'kena' Poss <knz@thaumogen.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch-release-22.2 Used to mark release blockers and technical advisories for 22.2 C-test-failure Broken test (automatically or manually discovered). O-roachtest O-robot Originated from a bot. T-sql-queries SQL Queries Team
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants