cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
30.03k stars 3.79k forks source link

sql: use row-level TTL for rangelog, eventlog and web_sessions #89453

Open aadityasondhi opened 2 years ago

aadityasondhi commented 2 years ago

The system.web_session table is periodically purged. This is handled in purge_auth_seession.go and is controlled using cluster settings. An alternative (possibly better) would be to have the table configured with row-level ttl and have that manage these web_sessions.

Things to consider

related: https://github.com/cockroachdb/cockroach/pull/88766

Jira issue: CRDB-20259

Epic CRDB-21265

rafiss commented 2 years ago

It would probably benefit from doing a bit of up-front investigation, since there might be some complexity with getting the jobs framework to operate on a system table.