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: sqlsmith/setup=rand-tables/setting=default failed #109974

Closed
cockroach-teamcity opened this issue Sep 3, 2023 · 6 comments · Fixed by #110116
Closed

roachtest: sqlsmith/setup=rand-tables/setting=default failed #109974

cockroach-teamcity opened this issue Sep 3, 2023 · 6 comments · Fixed by #110116
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). FROZEN.branch-release-23.1.11-rc O-roachtest O-robot Originated from a bot. O-rsg Random Syntax Generator 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
Milestone

Comments

@cockroach-teamcity
Copy link
Member

cockroach-teamcity commented Sep 3, 2023

roachtest.sqlsmith/setup=rand-tables/setting=default failed with artifacts on release-23.1.10-rc @ 58ac87a9b24e1cfb446143dafe04808ea186637f:

(sqlsmith.go:244).func3: error: pq: internal error: non-inverted columns have no inverted source column ordinal
stmt:
EXPLAIN DELETE FROM
	defaultdb.public."t}\\x23able5" AS "ta""b305"
USING
	defaultdb.public."
table4" AS "ta\fb306"
WHERE
	st_intersects("ta""b305"."coL5_%q5"::GEOGRAPHY, "ta\fb306".co😤l4_2::GEOGRAPHY)::BOOL;
test artifacts and logs in: /artifacts/sqlsmith/setup=rand-tables/setting=default/run_1

Parameters: ROACHTEST_arch=amd64 , ROACHTEST_cloud=gce , ROACHTEST_cpu=4 , ROACHTEST_encrypted=false , ROACHTEST_ssd=0

Help

See: roachtest README

See: How To Investigate (internal)

See: Grafana

/cc @cockroachdb/sql-queries

This test on roachdash | Improve this report!

Jira issue: CRDB-31236

@cockroach-teamcity cockroach-teamcity added FROZEN.branch-release-23.1.11-rc 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 3, 2023
@cockroach-teamcity cockroach-teamcity added this to the 23.1 milestone Sep 3, 2023
@mgartner mgartner self-assigned this Sep 6, 2023
@mgartner
Copy link
Collaborator

mgartner commented Sep 6, 2023

Reduced:

CREATE TABLE t1 (
  g1 GEOGRAPHY
);

CREATE TABLE t2 (
  k2 INT PRIMARY KEY,
  g2 GEOGRAPHY,
  INVERTED INDEX (k2, g2) NOT VISIBLE
);

EXPLAIN
DELETE FROM t2 USING t1 WHERE st_intersects(t2.g2, t1.g1);

Full stacktrace:

ERROR: internal error: non-inverted columns have no inverted source column ordinal
SQLSTATE: XX000
DETAIL: stack trace:
github.com/cockroachdb/cockroach/pkg/sql/opt/cat/column.go:166: InvertedSourceColumnOrdinal()
github.com/cockroachdb/cockroach/pkg/sql/opt/indexrec/hypothetical_index.go:275: hasPrefixOfExplicitCols()
github.com/cockroachdb/cockroach/pkg/sql/opt/indexrec/rec.go:171: findBestExistingIndexToReplace()
github.com/cockroachdb/cockroach/pkg/sql/opt/indexrec/rec.go:248: constructIndexRec()
github.com/cockroachdb/cockroach/pkg/sql/opt/indexrec/rec.go:321: outputIndexRec()
github.com/cockroachdb/cockroach/pkg/sql/opt/indexrec/rec.go:71: FindRecs()
github.com/cockroachdb/cockroach/pkg/sql/plan_opt.go:796: makeQueryIndexRecommendation()
github.com/cockroachdb/cockroach/pkg/sql/plan_opt.go:584: buildExecMemo()
github.com/cockroachdb/cockroach/pkg/sql/plan_opt.go:240: makeOptimizerPlan()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:2163: makeExecPlan()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:1655: dispatchToExecutionEngine()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:1070: execStmtInOpenState()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:144: func1()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:3235: execWithProfiling()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:143: execStmt()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:2219: func1()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:2224: execCmd()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:2141: run()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:953: ServeConn()
github.com/cockroachdb/cockroach/pkg/sql/pgwire/conn.go:247: processCommands()
github.com/cockroachdb/cockroach/pkg/sql/pgwire/server.go:999: func3()
GOROOT/src/runtime/asm_arm64.s:1172: goexit()

Looks like a bug with index recommendations.

@mgartner mgartner added the T-sql-queries SQL Queries Team label Sep 6, 2023
@mgartner
Copy link
Collaborator

mgartner commented Sep 6, 2023

Looks like this was introduced in #108576, so it's not yet been released.

@mgartner
Copy link
Collaborator

mgartner commented Sep 6, 2023

Nevermind, this PR was backported. I'll figure out which releases this affects.

@mgartner mgartner added the branch-release-22.2 Used to mark release blockers and technical advisories for 22.2 label Sep 6, 2023
@mgartner
Copy link
Collaborator

mgartner commented Sep 6, 2023

This was not backported to v23.1.9-rc branch, so we're safe there. It was backported before the v23.1.10-rc branch was cut, so we'll need to backport the fix to that branch. We'll also want to backport the fix to v22.2.

craig bot pushed a commit that referenced this issue Sep 6, 2023
110116: indexrec: fix internal error with inverted indexes r=mgartner a=mgartner

A bug was introduced in #108576 in code that compares index columns of
an existing index and a hypothetical index. Prior to this commit, this
logic only checked that the hypothetical index column was an inverted
column (the last explicitly indexed column in an inverted index) before
fetching the inverted source column ordinal for both the hypothetical
and existing index column. When the existing index column was not an
inverted column, and internal error would occur.

This commit fixes the bug by checking that both the hypothetical and
existing index columns are inverted columns before fetching the source
column ordinals.

There is no release note because this bug does not exist in any
releases.

Fixes #109974

Release note: None


Co-authored-by: Marcus Gartner <marcus@cockroachlabs.com>
@craig craig bot closed this as completed in b10ee46 Sep 6, 2023
blathers-crl bot pushed a commit that referenced this issue Sep 6, 2023
A bug was introduced in #108576 in code that compares index columns of
an existing index and a hypothetical index. Prior to this commit, this
logic only checked that the hypothetical index column was an inverted
column (the last explicitly indexed column in an inverted index) before
fetching the inverted source column ordinal for both the hypothetical
and existing index column. When the existing index column was not an
inverted column, and internal error would occur.

This commit fixes the bug by checking that both the hypothetical and
existing index columns are inverted columns before fetching the source
column ordinals.

There is no release note because this bug does not exist in any
releases.

Fixes #109974

Release note: None
blathers-crl bot pushed a commit that referenced this issue Sep 6, 2023
A bug was introduced in #108576 in code that compares index columns of
an existing index and a hypothetical index. Prior to this commit, this
logic only checked that the hypothetical index column was an inverted
column (the last explicitly indexed column in an inverted index) before
fetching the inverted source column ordinal for both the hypothetical
and existing index column. When the existing index column was not an
inverted column, and internal error would occur.

This commit fixes the bug by checking that both the hypothetical and
existing index columns are inverted columns before fetching the source
column ordinals.

There is no release note because this bug does not exist in any
releases.

Fixes #109974

Release note: None
mgartner added a commit to mgartner/cockroach that referenced this issue Sep 6, 2023
A bug was introduced in cockroachdb#108576 in code that compares index columns of
an existing index and a hypothetical index. Prior to this commit, this
logic only checked that the hypothetical index column was an inverted
column (the last explicitly indexed column in an inverted index) before
fetching the inverted source column ordinal for both the hypothetical
and existing index column. When the existing index column was not an
inverted column, and internal error would occur.

This commit fixes the bug by checking that both the hypothetical and
existing index columns are inverted columns before fetching the source
column ordinals.

There is no release note because this bug does not exist in any
releases.

Fixes cockroachdb#109974

Release note: None
@celiala
Copy link
Collaborator

celiala commented Sep 6, 2023

I'm going to open this issue, to track that the backports to 22.2 and release-23.1.10-rc are still open/unmerged.

@celiala celiala reopened this Sep 6, 2023
@celiala
Copy link
Collaborator

celiala commented Sep 6, 2023

they just merged -- closing issue then :)

@celiala celiala closed this as completed Sep 6, 2023
@michae2 michae2 added the O-rsg Random Syntax Generator label Sep 8, 2023
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). FROZEN.branch-release-23.1.11-rc O-roachtest O-robot Originated from a bot. O-rsg Random Syntax Generator 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
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants