Skip to content

sql: check row level ttl change before truncating a table#98537

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
chengxiong-ruan:check-row-ttl-mutation-when-truncate
Mar 14, 2023
Merged

sql: check row level ttl change before truncating a table#98537
craig[bot] merged 1 commit intocockroachdb:masterfrom
chengxiong-ruan:check-row-ttl-mutation-when-truncate

Conversation

@chengxiong-ruan
Copy link
Copy Markdown
Contributor

Fixes: #93443

Release note (sql change): This commit fixed a bug where crdb paniced wehn user tried to truncate a table which is has an ongoing row level ttl change. We still don't support table truncates in this scenario, but a more gentle unimplemented error is returned instead of panic.

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

SELECT id FROM system.namespace WHERE name = 't1';

statement ok
WITH to_json AS (
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

doing manual mutation upsert instead of using pausing points because it takes too long for a test to run.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤔 if you set the cluster settings like this it should be faster:

statement ok
SET CLUSTER SETTING jobs.registry.interval.adopt = '50ms';
# Lower the job registry loop interval to accelerate the test.
statement ok
SET CLUSTER SETTING jobs.registry.interval.cancel = '50ms'

My sense is that it'd make for a better test.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

oh wow. that does help. will update it.

@chengxiong-ruan chengxiong-ruan force-pushed the check-row-ttl-mutation-when-truncate branch from 7beb7ac to 5759164 Compare March 13, 2023 22:22
Copy link
Copy Markdown
Contributor

@ajwerner ajwerner left a comment

Choose a reason for hiding this comment

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

LGTM

Fixes: cockroachdb#93443

Release note (sql change): This commit fixed a bug where crdb
paniced wehn user tried to truncate a table which is has an
ongoing row level ttl change. We still don't support table
truncates in this scenario, but a more gentle unimplemented
error is returned instead of panic.
@chengxiong-ruan chengxiong-ruan force-pushed the check-row-ttl-mutation-when-truncate branch from 5759164 to 05f5bf2 Compare March 14, 2023 01:00
@chengxiong-ruan
Copy link
Copy Markdown
Contributor Author

TFTR!
bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Mar 14, 2023

Build failed (retrying...):

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Mar 14, 2023

Build succeeded:

@craig craig bot merged commit 3b326c3 into cockroachdb:master Mar 14, 2023
@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Mar 14, 2023

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 05f5bf2 to blathers/backport-release-22.2-98537: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

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

Backport to branch 22.2.x 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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sql: v22.2.0: cannot perform TRUNCATE due to concurrent unknown mutation

3 participants