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

ttljob: paginate ranges when doing TTL #76726

Merged
merged 1 commit into from
Feb 22, 2022

Conversation

otan
Copy link
Contributor

@otan otan commented Feb 17, 2022

This commit batches ranges instead of scanning them in all at once. The
range batch size is controlled by the cluster setting
sql.ttl.range_batch_size. I don't anticipate this needing to be
controlled per table.

Release note: None

@otan otan requested a review from rafiss February 17, 2022 11:10
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@otan otan mentioned this pull request Feb 17, 2022
30 tasks
@otan otan force-pushed the range_batch branch 2 times, most recently from c85a8ad to d16ada0 Compare February 17, 2022 11:35
Copy link
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! had some comments for future and a nit about the setting description

i'm not very familiar with this part of the KV api (like RangeMetaKey or MustAddr), so if needed, feel free to reach out to them for another review

pkg/sql/ttl/ttljob/ttljob.go Outdated Show resolved Hide resolved
@@ -317,7 +317,11 @@ func TestRowLevelTTLJobRandomEntries(t *testing.T) {
})
defer cleanupFunc()

rangeBatchSize := 1 + rng.Intn(3)
Copy link
Collaborator

Choose a reason for hiding this comment

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

if the default is 100, should the test be closer to that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we used a smaller number here here because we have less ranges (maximum of ~8).

@@ -317,7 +317,11 @@ func TestRowLevelTTLJobRandomEntries(t *testing.T) {
})
defer cleanupFunc()

rangeBatchSize := 1 + rng.Intn(3)
t.Logf("range batch size: %d", rangeBatchSize)
Copy link
Collaborator

Choose a reason for hiding this comment

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

random thought - we should have one place to randomize + log all the TTL settings

Copy link
Contributor Author

Choose a reason for hiding this comment

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

there is more or less this above -- it's just this is the only one randomised by a cluster setting

@otan
Copy link
Contributor Author

otan commented Feb 22, 2022

bors r=rafiss

thanks!

@craig
Copy link
Contributor

craig bot commented Feb 22, 2022

Canceled.

@otan
Copy link
Contributor Author

otan commented Feb 22, 2022

bors r=rafiss

craig bot pushed a commit that referenced this pull request Feb 22, 2022
76726: ttljob: paginate ranges when doing TTL r=rafiss a=otan

This commit batches ranges instead of scanning them in all at once. The
range batch size is controlled by the cluster setting
`sql.ttl.range_batch_size`. I don't anticipate this needing to be
controlled per table.

Release note: None

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

craig bot commented Feb 22, 2022

Build failed:

This commit batches ranges instead of scanning them in all at once. The
range batch size is controlled by the cluster setting
`sql.ttl.range_batch_size`. I don't anticipate this needing to be
controlled per table.

Release note: None
@otan
Copy link
Contributor Author

otan commented Feb 22, 2022

bors r=rafiss

@craig
Copy link
Contributor

craig bot commented Feb 22, 2022

🕐 Waiting for PR status (Github check) to be set, probably by CI. Bors will automatically try to run when all required PR statuses are set.

@craig
Copy link
Contributor

craig bot commented Feb 22, 2022

Build succeeded:

@craig craig bot merged commit a6064fe into cockroachdb:master Feb 22, 2022
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