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

ttl: add queries to job details #86801

Merged
merged 1 commit into from
Aug 26, 2022
Merged

Conversation

rafiss
Copy link
Collaborator

@rafiss rafiss commented Aug 24, 2022

fixes #81905

This helps with observability so users can understand what the TTL job
is doing behind the scenes.

The job details in the DB console will show:

ttl for defaultdb.public.t
-- for each range, iterate to find rows:
SELECT id FROM [108 AS tbl_name]
AS OF SYSTEM TIME '30s'
WHERE <crdb_internal_expiration OR ttl_expiration_expression> <= $1
AND (id) > (<range start>) AND (id) < (<range end>)
ORDER BY id
LIMIT <ttl_select_batch_size>
-- then delete with:
DELETE FROM [108 AS tbl_name]
WHERE <crdb_internal_expiration OR ttl_expiration_expression> <= $1
AND (id) IN (<rows selected above>)

Release note: None

Release justification: low risk change

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@rafiss rafiss changed the title sql: fix array decoding in COPY ttl: add queries to job details Aug 24, 2022
@rafiss rafiss force-pushed the ttl-job-details branch 3 times, most recently from 621a3f6 to a575680 Compare August 24, 2022 21:00
@rafiss rafiss marked this pull request as ready for review August 24, 2022 21:01
@rafiss rafiss requested review from a team, otan and ecwall August 24, 2022 21:01
Copy link
Contributor

@otan otan left a comment

Choose a reason for hiding this comment

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

whoever came up with this idea, i love it

@rafiss rafiss force-pushed the ttl-job-details branch 2 times, most recently from be53392 to 2b2bce3 Compare August 25, 2022 17:33
@rafiss
Copy link
Collaborator Author

rafiss commented Aug 25, 2022

tftr!

bors r=otan

@craig
Copy link
Contributor

craig bot commented Aug 25, 2022

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Aug 25, 2022

Build failed (retrying...):

@yuzefovich
Copy link
Member

I think there are some test failures here.

bors r-

@craig
Copy link
Contributor

craig bot commented Aug 25, 2022

Canceled.

This helps with observability so users can understand what the TTL job
is doing behind the scenes.

The job details in the DB console will show:
```
ttl for defaultdb.public.t
-- for each range, iterate to find rows:
SELECT id FROM [108 AS tbl_name]
AS OF SYSTEM TIME '30s'
WHERE <crdb_internal_expiration OR ttl_expiration_expression> <= $1
AND (id) > (<range start>) AND (id) < (<range end>)
ORDER BY id
LIMIT <ttl_select_batch_size>
-- then delete with:
DELETE FROM [108 AS tbl_name]
WHERE <crdb_internal_expiration OR ttl_expiration_expression> <= $1
AND (id) IN (<rows selected above>)
```

Release note: None

Release justification: low risk change
@rafiss
Copy link
Collaborator Author

rafiss commented Aug 26, 2022

fixed the tests, thanks for pointing that out

bors r=otan

@craig
Copy link
Contributor

craig bot commented Aug 26, 2022

Build succeeded:

@craig craig bot merged commit 3688055 into cockroachdb:master Aug 26, 2022
@rafiss rafiss deleted the ttl-job-details branch August 26, 2022 16:31
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: Observability improvements meta issue for TTL deletions jobs
4 participants