-
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
auth: periodically clean up expired sessions in the web_sessions
system table
#51169
Comments
Hi @dhartunian, I've guessed the C-ategory of your issue and suitably labeled it. Please re-label if inaccurate. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
I have investigated this a little bit.
So here's a possible strategy:
The code of Then:
|
@knz To be clear, the |
yes. You can think about "expiration timeout" as "after this time, the user cannot login any more"
yes. with emphasis on "have not been used". |
67547: auth: set up periodic deletion of old sessions in the `web_sessions` system table r=knz,mberhault a=cameronnunez Fixes [#51169](#51169). Expired sessions are not cleaned up in the web_sessions system table quickly enough. The table should be kept from growing indefinitely in the long run. This patch sets up periodic deletion of these expired sessions. Release note (security update): Old authentication web session rows in the system.web_sessions table no longer accumulate indefinitely in the long run. These rows are periodically deleted. Refer to the reference docs for details about the new cluster settings for system.web_sessions. 68310: util/cgroups: method to read file-backed memory on inactive LRU list r=abarganier a=abarganier util/cgroups: method to read file-backed memory on inactive LRU list Currently we have methods that allows us to read the cgroup memory limit, as well as the current memory usage, for processes running in unix containers. However, to more accurately determine the current memory usage in the eyes of the container provider, we must subtract the "cache usage" from the total memory usage, which is represented by the inactive file-backed memory stat. From the Docker documentation: "On Linux, the Docker CLI reports memory usage by subtracting cache usage from the total memory usage. The API does not perform such a calculation but rather provides the total memory usage and the amount from the cache so that clients can use the data as needed. The cache usage is defined as the value of total_inactive_file field in the memory.stat file on cgroup v1 hosts...On cgroup v2 hosts, the cache usage is defined as the value of inactive_file field." https://docs.docker.com/engine/reference/commandline/stats/#extended-description In an effort to gain better observability into current memory usage in the eyes of the container provider for purposes of identifying whether or not a CRDB node is on its way to OOM, we add the ability to read these values from the memory subsystem. This heuristic can then be used in debug tools such as periodic query dumps and eventually, more generalized crash dump platforms. Informs #66901 68337: importccl: only initialize progress fields on first import attempt r=pbardea a=pbardea Fixes #68247. Release note (bug fix): Fix a bug where IMPORT would incorrectly reset its progress upon resumption. 68394: storage: elide nonexistent files from registry r=jbowens a=jbowens When the encryption-at-rest registry is loaded, elide any file entries corresponding to files that do not exist on the filesystem. These entries may exist because files were manually deleted by an operator, an operation to update the registry failed or because the files were deleted through a codepath that failed to update the registry. Release note (bug fix): Fixes a bug where encryption-at-rest registry would accumulate nonexistent file entries forever, contributing to filesystem operations' latency on the store. ---- I'd like to follow this up with a change that implements `RemoveAll` on `encryptedFS`. It's not as straightforward of a change. This patch at least ensures process restarts clear all accumulated garbage. 68697: opt: add format=hide-hist option r=mgartner a=mgartner The `format=hide-hist` option for optimizer tests has been added. It allows stats to be shown in optimizer test output without histograms. This is useful during debugging when you want to view stats like row count, but do not want the clutter of histograms. Additionally, using `format=show-stats` with `optstepsweb` creates base-64 encoded URLs longer than the maximum URL length supported by browsers (typically ~2000 characters). You can now use `optstepsweb format=(show-stats,hide-hist)` to view high-level statistics in `optstepsweb`. Release note: None 68743: sql: prevent internal error when altering database placement r=mgartner a=mgartner The parser was updated in #68068 to support a new syntax for altering database placement: ALTER DATABASE d SET PLACEMENT DEFAULT ALTER DATABASE d SET PLACEMENT RESTRICTED Running these statements causes internal errors because there is no execution support for them yet. This commit prevents an internal error when they are executed, and returns a user-friendly error instead. Informs #65475 Release note: None 68796: sql: fix panic using Reset() when using sqlstats iterator r=knz,maryliag a=Azhng Previously, when if SQLStats.Reset() is called while iterating through an iterator, this will cause panics since the iterator will then return a nil pointer. This commit changed the iterator to gracefully handle this situation and prevents panic. Resolves #68785 Release note: None Co-authored-by: Cameron Nunez <[email protected]> Co-authored-by: Alex Barganier <[email protected]> Co-authored-by: Paul Bardea <[email protected]> Co-authored-by: Jackson Owens <[email protected]> Co-authored-by: Marcus Gartner <[email protected]> Co-authored-by: Azhng <[email protected]>
Is your feature request related to a problem? Please describe.
In the long run, the
web_sessions
table will currently continue to grow and accumulate expired sessions indefinitely.Describe the solution you'd like
The table should either delete a user's old sessions upon creating a new session for them, or periodically delete expired sessions from the table to keep it from growing indefinitely.
Describe alternatives you've considered
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered: