-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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: finalize for v22.1 release #76918
Conversation
b2b7b2c
to
a95d147
Compare
Supporting descending order PKs is complex as it requires a more complicated pagination algorithm. As such, let's not support such a table for now. Release note: None
Release note: None
Release note: None
Note we allow this for CREATE TABLE so SHOW CREATE TABLE round trips. But we should never need this for the ALTER TABLE ... SET ... Release note: None
a0bb13e
to
6681c29
Compare
Release note: None
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!!
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @otan and @rafiss)
-- commits, line 40 at r6:
nit: "which is available as a beta feature"
-- commits, line 65 at r6:
nit: maybe mention that the rate is per second?
pkg/sql/catalog/tabledesc/structured.go, line 2527 at r5 (raw file):
// GetStorageParams implements the TableDescriptor interface. func (desc *wrapper) GetStorageParams(spaceBetweenEqual bool) []string {
i wonder if there's a good way to make sure we don't forget to update this function when new storage params are added
This commit fixes up any post-v22.1 TODOs with unimplemented messages or comments annotations for the future. Release note (sql change): We introduce a new row level TTL feature to CockroachDB, which is available as a beta feature. This allows users to use a special syntax to automatically mark rows for deletion. Rows are deleted using a SCHEDULED JOB. A user can create a table with TTL using: ``` CREATE TABLE t (id INT PRIMARY KEY) WITH (ttl_expire_after = '10 mins') ``` Where `ttl_expire_after` is a duration expression. A user can also add TTL to an existing table using ``` ALTER TABLE t SET (ttl_expire_after = '10 mins') ``` This creates a new column, `crdb_internal_expiration`, which automatically is set to `now() + ttl_expire_after` when inserted by default or on update. The scheduled job will delete any rows which exceed this timestamp as of the beginning of the job run. The TTL job is configurable in a few ways using the WITH/SET syntax: * ttl_select_batch_size: how many rows to select at once (by default it is cluster setting sql.ttl.default_select_batch_size) * ttl_delete_batch_size: how many rows to delete at once (default cluster setting sql.ttl.default_select_batch_size) * ttl_delete_rate_limit: maximum rows to delete per second for the given table (default cluster setting sql.default.default_delete_rate_limit) * ttl_pause: pauses the TTL job (also globally pausable with `sql.ttl.job.enabled`). Using `ALTER TABLE table_name RESET (<parameter>)` will reset the parameter to re-use the default, or `RESET(ttl)` will disable the TTL job for the table and remove the `crdb_internal_expiration` column.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @rafiss)
pkg/sql/catalog/tabledesc/structured.go, line 2527 at r5 (raw file):
Previously, rafiss (Rafi Shamim) wrote…
i wonder if there's a good way to make sure we don't forget to update this function when new storage params are added
maybe check all CREATE TABLE in logic test is self reproducing, heh....
bors r=rafiss |
This PR was included in a batch that was canceled, it will be automatically retried |
Build succeeded: |
See individual commits for details.
Big release note on the last commit.