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

cdctest: use legacy schema changer when sql smith is enabled #139914

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

wenyihu6
Copy link
Contributor

@wenyihu6 wenyihu6 commented Jan 27, 2025

This patch disables the declarative schema changer when TestChangefeedNemeses
uses SQLSmith. Enabling it causes a decoder error, so it is temporarily disabled
as a workaround. This ensures nemesis testing can run in CI with SQLSmith
without being skipped.

Informs: #137125
Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

withLegacySchemaChanger := maybeDisableDeclarativeSchemaChangesForTest(t, sqlDB)

v, err := cdctest.RunNemesis(f, s.DB, t.Name(), withLegacySchemaChanger, rng, nop)
disable := nop.EnableSQLSmith || rng.Float32() < 0.1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this context, I would want to name "disable" something more descriptive, maybe keeping it as "withLegacySchemaChanger"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -25,17 +25,18 @@ func TestChangefeedNemeses(t *testing.T) {
skip.UnderRace(t, "takes >1 min under race")

testutils.RunValues(t, "nemeses_options=", cdctest.NemesesOptions, func(t *testing.T, nop cdctest.NemesesOption) {
if nop.EnableSQLSmith == true {
skip.WithIssue(t, 137125)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to note that this is a temporary fix with a comment or TODO or something. Before, this line linked it to this issue (137125). Is it worth keeping another pointer to that issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

This patch disables the declarative schema changer when TestChangefeedNemeses
uses SQLSmith. Enabling it causes a decoder error, so it is temporarily disabled
as a workaround. This ensures nemesis testing can run in CI with SQLSmith
without being skipped.

Informs: cockroachdb#137125
Release note: None
@wenyihu6 wenyihu6 marked this pull request as ready for review January 28, 2025 17:14
@wenyihu6 wenyihu6 requested a review from a team as a code owner January 28, 2025 17:14
@wenyihu6 wenyihu6 requested review from rharding6373 and removed request for a team and rharding6373 January 28, 2025 17:14
@wenyihu6
Copy link
Contributor Author

Extended CI failed under stress due to timeouts not related to this bug fix. TFTR!

bors r=aerfrei

craig bot pushed a commit that referenced this pull request Jan 28, 2025
139914: cdctest: use legacy schema changer when sql smith is enabled r=aerfrei a=wenyihu6

This patch disables the declarative schema changer when TestChangefeedNemeses
uses SQLSmith. Enabling it causes a decoder error, so it is temporarily disabled
as a workaround. This ensures nemesis testing can run in CI with SQLSmith
without being skipped.

Informs: #137125
Release note: None

139959: go.mod: bump Pebble to 1157615755bc r=RaduBerinde a=jbowens

Changes:

 * [`11576157`](cockroachdb/pebble@11576157) db: add optional ValidateKey Comparer func
 * [`303c8855`](cockroachdb/pebble@303c8855) metamorphic: fix time-bound filtering
 * [`89cae40f`](cockroachdb/pebble@89cae40f) Update stale comment in comparer.go
 * [`a4761ee8`](cockroachdb/pebble@a4761ee8) cache: readShard: use a separate mutex
 * [`16466355`](cockroachdb/pebble@16466355) cockroachkvs: pull in MVCC block-property collector, filter
 * [`2fa3b969`](cockroachdb/pebble@2fa3b969) internal/metamorphic: fix bugs in KeyFormat abstraction
 * [`6c523bfb`](cockroachdb/pebble@6c523bfb) metamorphic: ignore rangedels for deduplicating point prefixes

Release note: none.
Epic: none.

Co-authored-by: Wenyi Hu <[email protected]>
Co-authored-by: Jackson Owens <[email protected]>
@craig
Copy link
Contributor

craig bot commented Jan 28, 2025

Build failed (retrying...):

craig bot pushed a commit that referenced this pull request Jan 28, 2025
139265: opt: remove incorrect query plans for trigram similarity filters r=normanchenn a=normanchenn

Previously, the optimizer would produce incorrect query plans for queries with trigram similarity filters when `pg_trgm.similarity_threshold == 0`, producing incorrect results.

To address this, this patch adds a check to return early if `pg_trgm.similarity_threshold == 0` in trigram similarity queries on inverted indices.

Fixes: #122443

Release note (bug fix): The optimizer could produce incorrect query plans for queries using trigram similarity filters (e.g. `col % 'val'`) when `pg_trgm.similarity_threshold` was set to 0. This bug was introduced in v22.2.0 and is now fixed. Note that this issue does not affect v24.2.0+ releases when the `optimizer_use_trigram_similarity_optimization` session variable (introduced in v24.2.0) is set to its default value `true`, as it would skip this behaviour.

139914: cdctest: use legacy schema changer when sql smith is enabled r=aerfrei a=wenyihu6

This patch disables the declarative schema changer when TestChangefeedNemeses
uses SQLSmith. Enabling it causes a decoder error, so it is temporarily disabled
as a workaround. This ensures nemesis testing can run in CI with SQLSmith
without being skipped.

Informs: #137125
Release note: None

Co-authored-by: Norman Chen <[email protected]>
Co-authored-by: Wenyi Hu <[email protected]>
@craig
Copy link
Contributor

craig bot commented Jan 28, 2025

Build failed (retrying...):

craig bot pushed a commit that referenced this pull request Jan 28, 2025
139914: cdctest: use legacy schema changer when sql smith is enabled r=aerfrei a=wenyihu6

This patch disables the declarative schema changer when TestChangefeedNemeses
uses SQLSmith. Enabling it causes a decoder error, so it is temporarily disabled
as a workaround. This ensures nemesis testing can run in CI with SQLSmith
without being skipped.

Informs: #137125
Release note: None

Co-authored-by: Wenyi Hu <[email protected]>
@craig
Copy link
Contributor

craig bot commented Jan 28, 2025

Build failed:

@wenyihu6
Copy link
Contributor Author

bors retry

craig bot pushed a commit that referenced this pull request Jan 28, 2025
139914: cdctest: use legacy schema changer when sql smith is enabled r=aerfrei a=wenyihu6

This patch disables the declarative schema changer when TestChangefeedNemeses
uses SQLSmith. Enabling it causes a decoder error, so it is temporarily disabled
as a workaround. This ensures nemesis testing can run in CI with SQLSmith
without being skipped.

Informs: #137125
Release note: None

Co-authored-by: Wenyi Hu <[email protected]>
@craig
Copy link
Contributor

craig bot commented Jan 28, 2025

Build failed:

@wenyihu6
Copy link
Contributor Author

Unit tests failures seem unrelated and are known flakes.

bors retry

@craig craig bot merged commit 630c342 into cockroachdb:master Jan 28, 2025
21 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants