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

sql: the "updatedAt" column in system.web_sessions is not used anywhere and should be removed #90790

Open
knz opened this issue Oct 27, 2022 · 0 comments
Labels
C-cleanup Tech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior. T-observability

Comments

@knz
Copy link
Contributor

knz commented Oct 27, 2022

This column was spelled out in the original RFC (docs/RFCS/20170628_web_session_login.md) but is not used anywhere.
It's always NULL.

On the other hand, we probably do not want to use it anyway: storing an update to it upon every access to an HTTP API would be too expensive.

So it should be simply removed and the corresponding mechanisms simplified.

Jira issue: CRDB-20948

Epic CRDB-21265

@knz knz added C-cleanup Tech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior. T-observability-inf labels Oct 27, 2022
craig bot pushed a commit that referenced this issue Nov 17, 2022
90789: server: use a common logic for system log gc r=dhartunian a=knz

Fixes #90521.
Subsumes #90523.
Subsumes #88766.
Informs #89453.
Informs #90790.

Prior to this patch, we had two problems:

- the code to GC system.eventlog was not running on secondary tenants.

  This was the original motivation for the work in this commit.

- there were 2 separate implementations of GC, one for system.eventlog/rangelog and another one for system.web_sessions.

  This was unfortunate because the first one is generic and was meant to be reused. Its implementation is just better all around: it is actually able to remove all rows when there are more than 1000 entries to delete at a time (this was a known limitation of the web_session cleanup code), and is optimized to avoid hitting tombstones when iterating.

This commit improves the situation by using the common, better implementation for both cases.

We acknowledge that with the advent of row-level TTL in SQL, all this would be better served by a conversion of these tables to use row-level TTL. However, the fix here (run GC in secondary tenants) needs to be backported, so we are shy to rely on the row-level TTL which didn't work as well in previous versions. The remainder of this work is described in #89453.

Release note (ops change): The cluster settings
`server.web_session.purge.period` and
`server.web_session.purge.max_deletions_per_cycle`, which were specific to the cleanup function for `system.web_sessions`, have been replaced by `server.log_gc.period` and
`server.log_gc.max_deletions_per_cycle` which apply to the cleanup function for `system.eventlog`, `system.rangelog` and `system.web_sessions` equally.

Release note (ops change): The cluster setting `server.web_session.auto_logout.timeout` has been removed. It had never been effective.


Co-authored-by: Raphael 'kena' Poss <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Tech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior. T-observability
Projects
None yet
Development

No branches or pull requests

1 participant