-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Sessionstorage is constantly growing #5010
Comments
My first guess is that you can delete them after stopping Etherpad in case you run the default configuration (no special auth plugins and settings.json with requireAuthentication:false, requireAuthorization:false), but I'll take a deeper look when I have more time. Afaik sessions would just be re-generated as soon as users reconnect - but I need to be sure about this. They are different from group sessions (which you'd use, if you run an instance that can't be used without a valid session and generate the sessions via API), and thus as you noticed the script won't work. They are also not used for author information (user names/author attribution across pads). What they are used for is accessing /admin endpoints and other auth stuff depending on your configuration/plugins used. #4898 has more discussion on the underlying issue. |
Thanks for etherpad as software and the fast reply. Thanks for pointing me to this issue. If I calculated this correct, those 16 million session won't require more space than 300MB, so this is fine. But I think it would be great if they could expire automatically or by or a session garbage collector job :) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Reopening again, as #4898 does not necessarly require cleaning up old sessions... |
Design idea:
A problem with the above scheme: The constant Another problem: We would need to clean up old session records after a dirty shutdown, or after upgrading from a version of Etherpad that doesn't expire sessions. ueberdb doesn't have cursor support so we can't just iterate over all records that match
To clean up legacy const alphabet = 'abcdefghijklmnopqrstuvwxyz';
const sidCharset = `_-0123456789${alphabet}${alphabet.toUpperCase()}`;
for (const chars of cartesianProductGenerator(Array(4).fill(sidCharset))) {
for (const key of getAllDbKeysWithPrefix(`sessionstorage:${chars.join('')}`) {
deleteDbRecord(key);
}
} But it would probably be better to just have the user issue a native DB query to delete all of the legacy records. |
The session storage seems to be constantly growing
When running etherpad we see a constantly growing number of session storage values in the database.
Is there a way to clean them up? We already looked into the script, which didn't help. https://github.com/ether/etherpad-lite/blob/develop/src/bin/deleteAllGroupSessions.js . So it seems that this sessions are no group sessions.
A standard session storage entry looks like:
Server (please complete the following information):
Additional context
All session storage keys values from mariadb:
None session storage keys values from mariadb:
The text was updated successfully, but these errors were encountered: