Skip to content

workload/schemachanger: stabilize workload for mixed version issues#162261

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
fqazi:fixMixedVersionWorkload
Feb 4, 2026
Merged

workload/schemachanger: stabilize workload for mixed version issues#162261
craig[bot] merged 1 commit intocockroachdb:masterfrom
fqazi:fixMixedVersionWorkload

Conversation

@fqazi
Copy link
Copy Markdown
Collaborator

@fqazi fqazi commented Feb 2, 2026

Previously, when we added logic to fetch whether a column has an
on_update expression from information_schema, we did not version gate it
appropriately. This could result in failures in mixed-version
environments. This patch adds a version gate and speculatively assumes
that, in mixed-version environments, every column has this expression.
We also expect uncatagorized errors when setting storage parameters
during mixed version, due to float errors hitting problems.

Fixes: #159458

Release note: None

@fqazi fqazi requested a review from a team February 2, 2026 21:39
@fqazi fqazi requested a review from a team as a code owner February 2, 2026 21:40
@fqazi fqazi requested review from DarrylWong and nameisbhaskar and removed request for a team February 2, 2026 21:40
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Collaborator

@rafiss rafiss left a comment

Choose a reason for hiding this comment

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

thanks for tracking these down, just had small questions

@rafiss made 3 comments.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @DarrylWong, @fqazi, and @nameisbhaskar).


pkg/sql/paramparse/paramparse.go line 43 at r1 (raw file):

	switch v := eval.UnwrapDatum(ctx, evalCtx, val).(type) {
	case *tree.DString:
		val, err := strconv.ParseFloat(string(*v), 64)

i fixed a few of these here too: #161472

let's make this error consistent:

if err != nil {
  return 0, pgerrors.Wrapf(pgcode.InvalidParameterValue, err, "error decoding %q", name)
}

also, do you know why #161472 was not sufficient? can you add a basic logictest showing what wasn't being handled before?


pkg/workload/schemachange/operation_generator.go line 3742 at r2 (raw file):

      FROM information_schema.columns
		 WHERE table_name SIMILAR TO 'table_w[0-9]_+%%' AND column_name <> 'rowid'
		       AND column_name NOT LIKE 'crdb_internal%%%%'

why do we need %%%%? it seems like the %% before may have been a mistake

@fqazi fqazi force-pushed the fixMixedVersionWorkload branch from 489ecbb to 8b590eb Compare February 2, 2026 22:00
Copy link
Copy Markdown
Collaborator Author

@fqazi fqazi left a comment

Choose a reason for hiding this comment

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

@fqazi made 2 comments.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @DarrylWong, @nameisbhaskar, and @rafiss).


pkg/workload/schemachange/operation_generator.go line 3742 at r2 (raw file):

Previously, rafiss (Rafi Shamim) wrote…

why do we need %%%%? it seems like the %% before may have been a mistake

Done.


pkg/sql/paramparse/paramparse.go line 43 at r1 (raw file):

Previously, rafiss (Rafi Shamim) wrote…

i fixed a few of these here too: #161472

let's make this error consistent:

if err != nil {
  return 0, pgerrors.Wrapf(pgcode.InvalidParameterValue, err, "error decoding %q", name)
}

also, do you know why #161472 was not sufficient? can you add a basic logictest showing what wasn't being handled before?

I backed this part out, and it was because I was on a stale master 🤦 .

Copy link
Copy Markdown
Collaborator Author

@fqazi fqazi left a comment

Choose a reason for hiding this comment

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

@fqazi made 1 comment.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @DarrylWong, @nameisbhaskar, and @rafiss).


pkg/sql/paramparse/paramparse.go line 43 at r1 (raw file):

Previously, fqazi (Faizan Qazi) wrote…

I backed this part out, and it was because I was on a stale master 🤦 .

We only need to handle the mixed version case

@fqazi fqazi changed the title workload/schemachanger: stabilize workload and fix invalid float handling workload/schemachanger: stabilize workload for mixed version issues Feb 2, 2026
@fqazi fqazi requested a review from rafiss February 2, 2026 23:47
Copy link
Copy Markdown
Collaborator

@rafiss rafiss left a comment

Choose a reason for hiding this comment

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

:lgtm:

@rafiss reviewed 1 file and made 1 comment.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @DarrylWong and @nameisbhaskar).

@fqazi
Copy link
Copy Markdown
Collaborator Author

fqazi commented Feb 3, 2026

@rafiss TFTR!

bors r+

@cockroachdb cockroachdb deleted a comment from craig bot Feb 3, 2026
@cockroachdb cockroachdb deleted a comment from craig bot Feb 3, 2026
@cockroachdb cockroachdb deleted a comment from craig bot Feb 3, 2026
@cockroachdb cockroachdb deleted a comment from craig bot Feb 3, 2026
@fqazi
Copy link
Copy Markdown
Collaborator Author

fqazi commented Feb 3, 2026

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Feb 3, 2026

👎 Rejected by PR status

Previously, when we added logic to fetch whether a column has an
on_update expression from information_schema, we did not version gate it
appropriately. This could result in failures in mixed-version
environments. This patch adds a version gate and speculatively assumes
that, in mixed-version environments, every column has this expression.
We also expect uncatagorized errors when setting storage parameters
during mixed version, due to float errors hitting problems.

Fixes: cockroachdb#159458

Release note: None
@fqazi fqazi force-pushed the fixMixedVersionWorkload branch from 8b590eb to 8c870d1 Compare February 3, 2026 18:39
@fqazi
Copy link
Copy Markdown
Collaborator Author

fqazi commented Feb 3, 2026

bors r+

1 similar comment
@fqazi
Copy link
Copy Markdown
Collaborator Author

fqazi commented Feb 3, 2026

bors r+

@fqazi
Copy link
Copy Markdown
Collaborator Author

fqazi commented Feb 4, 2026

bors ping

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Feb 4, 2026

pong

@fqazi
Copy link
Copy Markdown
Collaborator Author

fqazi commented Feb 4, 2026

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Feb 4, 2026

@craig craig bot merged commit ae0995c into cockroachdb:master Feb 4, 2026
26 checks passed
@fqazi
Copy link
Copy Markdown
Collaborator Author

fqazi commented Feb 4, 2026

blathers backport 26.1

@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Feb 4, 2026

Based on the specified backports for this PR, I applied new labels to the following linked issue(s). Please adjust the labels as needed to match the branches actually affected by the issue(s), including adding any known older branches.


Issue #159458: branch-release-26.1.


🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Feb 4, 2026

Encountered an error creating backports. Some common things that can go wrong:

  1. The backport branch might have already existed.
  2. There was a merge conflict.
  3. The backport branch contained merge commits.

You might need to create your backport manually using the backport tool.


error creating merge commit from 8c870d1 to blathers/backport-release-26.1-162261: POST https://api.github.com/repos/fqazi/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 26.1 failed. See errors above.


🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

roachtest: schemachange/mixed-versions failed [failed generating operation: createSchema: descriptor is being dropped]

3 participants