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

opt: tests failing with fast_int_set_large build tag #88126

Closed
mgartner opened this issue Sep 19, 2022 · 1 comment · Fixed by #88129
Closed

opt: tests failing with fast_int_set_large build tag #88126

mgartner opened this issue Sep 19, 2022 · 1 comment · Fixed by #88129
Labels
branch-release-22.2 Used to mark GA and release blockers, technical advisories, and bugs for 22.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

@mgartner
Copy link
Collaborator

mgartner commented Sep 19, 2022

Running make test PKG='./pkg/sql/opt/xform' TAGS'=fast_int_set_large' (or ./dev test pkg/sql/opt/xform -- --define gotags=bazel,gss,fast_int_set_large) causes the error below. We're likely missing a ColSet.Copy call somewhere.

--- FAIL: TestRules (1.97s)
    test_log_scope.go:161: test logs captured to: /var/folders/3j/7c3w0jjd14g4n19lvvrxtm2r0000gp/T/logTestRules565569366
    test_log_scope.go:79: use -show-logs to present logs inline
    --- FAIL: TestRules/join (0.75s)
        opt_tester.go:618: /Users/marcus/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/xform/testdata/rules/join:11172: output cols mismatch: (1) vs (1,18)
            (1) assertion failure
            Wraps: (2) attached stack trace
              -- stack trace:
              | github.com/cockroachdb/cockroach/pkg/sql/opt/props.(*Relational).VerifyAgainst
              |         /Users/marcus/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/props/verify.go:87
              | github.com/cockroachdb/cockroach/pkg/sql/opt/memo.(*Memo).CheckExpr
              |         /Users/marcus/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/memo/check_expr.go:54                                                                                    | github.com/cockroachdb/cockroach/pkg/sql/opt/memo.(*Memo).AddLookupJoinToGroup
              |         /Users/marcus/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/memo/expr.og.go:24503
              | github.com/cockroachdb/cockroach/pkg/sql/opt/xform.(*explorer).exploreLookupJoin
              |         /Users/marcus/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/xform/explorer.og.go:2572                                                                                | github.com/cockroachdb/cockroach/pkg/sql/opt/xform.(*explorer).exploreGroupMember
              |         /Users/marcus/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/xform/explorer.og.go:38
              | github.com/cockroachdb/cockroach/pkg/sql/opt/xform.(*explorer).exploreGroup                                                                                                        |         /Users/marcus/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/xform/explorer.go:181
              | github.com/cockroachdb/cockroach/pkg/sql/opt/xform.(*Optimizer).optimizeGroup                                                                                                      |         /Users/marcus/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/xform/optimizer.go:528
              | github.com/cockroachdb/cockroach/pkg/sql/opt/xform.(*Optimizer).optimizeEnforcer
              |         /Users/marcus/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/xform/optimizer.go:685
              | github.com/cockroachdb/cockroach/pkg/sql/opt/xform.(*Optimizer).enforceProps                                                                                                       |         /Users/marcus/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/xform/optimizer.go:645
              | github.com/cockroachdb/cockroach/pkg/sql/opt/xform.(*Optimizer).optimizeGroupMember
              |         /Users/marcus/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/xform/optimizer.go:555
              | github.com/cockroachdb/cockroach/pkg/sql/opt/xform.(*Optimizer).optimizeGroup                                                                                                      |         /Users/marcus/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/xform/optimizer.go:515
              | github.com/cockroachdb/cockroach/pkg/sql/opt/xform.(*Optimizer).Optimize
              |         /Users/marcus/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/xform/optimizer.go:261
              | github.com/cockroachdb/cockroach/pkg/sql/opt/testutils/opttester.(*OptTester).optimizeExpr
              |         /Users/marcus/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/testutils/opttester/opt_tester.go:2236
              | github.com/cockroachdb/cockroach/pkg/sql/opt/testutils/opttester.(*OptTester).OptimizeWithTables
              |         /Users/marcus/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/testutils/opttester/opt_tester.go:1152
              | github.com/cockroachdb/cockroach/pkg/sql/opt/testutils/opttester.(*OptTester).Optimize
              |         /Users/marcus/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/testutils/opttester/opt_tester.go:1139
              | github.com/cockroachdb/cockroach/pkg/sql/opt/testutils/opttester.(*OptTester).RunCommand
              |         /Users/marcus/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/testutils/opttester/opt_tester.go:616
              | github.com/cockroachdb/cockroach/pkg/sql/opt/xform_test.runDataDrivenTest.func1.1
              |         /Users/marcus/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/xform/optimizer_test.go:258
              | github.com/cockroachdb/datadriven.runDirective.func1
              |         /Users/marcus/go/src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/datadriven/datadriven.go:321
              | github.com/cockroachdb/datadriven.runDirective
              |         /Users/marcus/go/src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/datadriven/datadriven.go:326
              | github.com/cockroachdb/datadriven.runDirectiveOrSubTest
              |         /Users/marcus/go/src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/datadriven/datadriven.go:195
              | github.com/cockroachdb/datadriven.runTestInternal
              |         /Users/marcus/go/src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/datadriven/datadriven.go:168
              | github.com/cockroachdb/datadriven.RunTest
              |         /Users/marcus/go/src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/datadriven/datadriven.go:136
              | github.com/cockroachdb/cockroach/pkg/sql/opt/xform_test.runDataDrivenTest.func1
              |         /Users/marcus/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/xform/optimizer_test.go:255
              | github.com/cockroachdb/datadriven.Walk
              |         /Users/marcus/go/src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/datadriven/datadriven.go:413
              | github.com/cockroachdb/datadriven.Walk.func1
              |         /Users/marcus/go/src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/datadriven/datadriven.go:426
              | testing.tRunner
              |         /usr/local/opt/go/libexec/src/testing/testing.go:1446
              | runtime.goexit
              |         /usr/local/opt/go/libexec/src/runtime/asm_amd64.s:1594
            Wraps: (3) output cols mismatch: (1) vs (1,18)
            Error types: (1) *assert.withAssertionFailure (2) *withstack.withStack (3) *errutil.leafError
    optimizer_test.go:202: -- test log scope end --
FAIL
FAIL    github.com/cockroachdb/cockroach/pkg/sql/opt/xform      4.728s
FAIL

Jira issue: CRDB-19702

@mgartner mgartner added 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. branch-release-22.2 Used to mark GA and release blockers, technical advisories, and bugs for 22.2 labels Sep 19, 2022
@blathers-crl blathers-crl bot added the T-sql-queries SQL Queries Team label Sep 19, 2022
@mgartner
Copy link
Collaborator Author

The error does not occur for this test case if I disable the GenerateLocalityOptimizedAntiJoin exploration rule. It looks like we are copying the DerivedCols opt.ColSet and Col opt.ColSet fields of a LookupJoinPrivate without calling ColSet.Copy() in CreateLocalityOptimizedLookupJoinPrivate. I'll have a fix up shortly.

craig bot pushed a commit that referenced this issue Sep 19, 2022
88129: opt: copy ColSet in CreateLocalityOptimizedLookupJoinPrivateIncludingCols r=mgartner a=mgartner

`CreateLocalityOptimizedLookupJoinPrivateIncludingCols` was mutating a
`opt.ColSet` field of another `LookupJoinPrivate` because it was calling
`ColSet.UnionWith` without copying the `ColSet` first. This commit fixes
the bug.

Fixes #88126

Release note: None


88130: changefeedccl: avoid concurrent map access r=[miretskiy] a=HonoreDB

go 1.18 introduced more stringent checks for unsafe concurrent map use, surfacing some new and exciting panics in changefeed code.

When backported, fixes #87939
When backported, fixes #88089
When backported, fixes #87899

Release note (bug fix): Fixed crashes in changefeed code when running on recent go versions.

88134: kvserver: tweak a comment about raft snaps r=nvanbenschoten a=tbg

Suggested by Nathan[^1].

[^1]: #87702 (comment)

Release note: None


Co-authored-by: Marcus Gartner <[email protected]>
Co-authored-by: Aaron Zinger <[email protected]>
Co-authored-by: Tobias Grieger <[email protected]>
@craig craig bot closed this as completed in 67f18b3 Sep 19, 2022
blathers-crl bot pushed a commit that referenced this issue Sep 19, 2022
…Cols

`CreateLocalityOptimizedLookupJoinPrivateIncludingCols` was mutating a
`opt.ColSet` field of another `LookupJoinPrivate` because it was calling
`ColSet.UnionWith` without copying the `ColSet` first. This commit fixes
the bug.

Fixes #88126

Release note: None
@mgartner mgartner moved this to Done in SQL Queries Jul 24, 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 GA and release blockers, technical advisories, and bugs for 22.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
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants