-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Provide an internal function to deactivate multiple users more efficiently #19490
Comments
Hello @zulip/server-production members, this issue was labeled with the "area: production" label, so you may want to check it out! |
Probably the right way to do this is to rename it to |
@timabbott can I have a detailed explanation on this, I am newcomer to Zulip but already have some experience with Django and I would I like to proceed with this issue. |
@iamakkkhil sorry for the slow reply -- I was on vacation at the time. I think this is a pure refactoring function; first, refactor (Use |
Just adding a note that I think the path forward we're likely to take for the core issue here involves extending the Session table to record the User ID and Realm with database indexes, which is different from the previous proposal. |
@zulipbot claim |
Hello @abdelrahman725! Thanks for your interest in Zulip! You have attempted to claim an issue without the label "help wanted". You can only claim and submit pull requests for issues with the help wanted label. If this is your first time here, we recommend reading our guide for new contributors before getting started. |
@abdelrahman725 You have been unassigned from this issue because you have not made any updates for over 14 days. Please feel free to reclaim the issue if you decide to pick up again. Thanks! |
@zulipbot still working on it |
ERROR: You have already claimed this issue. |
@zulipbot claim |
Hello @abdelrahman725! Thanks for your interest in Zulip! You have attempted to claim an issue without the label "help wanted". You can only claim and submit pull requests for issues with the help wanted label. If this is your first time here, we recommend reading our guide for new contributors before getting started. |
Fixes zulip#19490 and has other performance benefits. Create RealmSession model with fields: realm, user and ip_address, indexed by realm and user. Migrate code to use the new model, zerver/lib/sessions' has most impact. This change introduced one extra query for 'assert_database_query_count()'
Fixes zulip#19490 and has other performance benefits. Create RealmSession model with fields: realm, user and ip_address, indexed by realm and user. Migrate code to use the new model, zerver/lib/sessions' has most impact. Create data_migration to copy over data from django_session to zerver_realmsession table.
Fixes zulip#19490 and has other performance benefits. Create RealmSession model with fields: realm, user and ip_address, indexed by realm and user. Migrate code to use the new model, zerver/lib/sessions' has most impact. Create data_migration to copy over data from django_session to zerver_realmsession table.
Fixes zulip#19490 and has other performance benefits. Create RealmSession model with fields: realm, user and ip_address, indexed by realm and user. Migrate code to use the new model, zerver/lib/sessions' has most impact. Create data_migration to copy over data from django_session to zerver_realmsession table.
Fixes zulip#19490 and has other performance benefits. Create RealmSession model with fields: realm, user and ip_address, indexed by realm and user. Migrate code to use the new model, zerver/lib/sessions' has most impact. Create data_migration to copy over data from django_session to zerver_realmsession table.
Fixes zulip#19490 and has other performance benefits. Create RealmSession model with fields: realm, user and ip_address, indexed by realm and user. Migrate code to use the new model, zerver/lib/sessions' has most impact. Create data_migration to copy over data from django_session to zerver_realmsession table.
Fixes zulip#19490 and has other performance benefits. Create RealmSession model with fields: realm, user and ip_address, with combined index on (realm, user) and an index on ip_address. Migrate code to use the new model, zerver/lib/sessions' has most impact. Create data_migration to copy over data from django_session to zerver_realmsession table.
Fixes zulip#19490 and has other performance benefits. Create RealmSession model with fields: realm, user and ip_address, indexed by (realm, user) and ip_address. Migrate code to use the new model, zerver/lib/sessions' has most impact. Create data_migration to copy over data from django_session to zerver_realmsession table.
Fixes zulip#19490 and has other performance benefits. Create RealmSession model with custom fields: realm, user and ip_address, indexed by (realm, user) and ip_address. Migrate code to use the new model, zerver/lib/sessions' has most impact. Create data_migration to copy over data from django_session to zerver_realmsession table.
Fixes zulip#19490 and has other performance benefits. Create RealmSession model with custom fields: realm, user and ip_address, indexed by (realm, user) and ip_address. Migrate code to use that new model, "zerver/lib/sessions" has most impact. Create data_migration to copy over data from django_session to zerver_realmsession table.
Fixes zulip#19490 and has other performance benefits. Create RealmSession model with custom fields: realm, user and ip_address, indexed by (realm, user) and ip_address. Migrate code to use that new model, "zerver/lib/sessions" has most impact. Create data_migration to copy over data from django_session to zerver_realmsession table.
Fixes zulip#19490 and has other performance benefits. Create RealmSession model with custom fields: realm, user and ip_address, indexed by (realm, user) and ip_address. Migrate code to use that model, "zerver/lib/sessions" has most impact. Create data_migration to copy over data from django_session to zerver_realmsession table.
Fixes zulip#19490 and has other performance benefits. Create RealmSession model with custom fields: realm, user and ip_address, indexed by (realm, user) and ip_address. Migrate code to use that model, "zerver/lib/sessions" has most impact. Create data_migration to copy over data from django_session table to zerver_realmsession table.
Fixes zulip#19490 and has other performance benefits. Create RealmSession model with custom fields: realm, user and ip_address, indexed by (realm, user) and ip_address. Migrate code to use that model, "zerver/lib/sessions" has most impact. Create data_migration to copy over data from django_session table to zerver_realmsession table.
Fixes zulip#19490 and has other performance benefits. Create RealmSession model with custom fields: realm, user and ip_address, indexed by (realm, user) and ip_address. Migrate code to use that model, "zerver/lib/sessions" has most impact. Create data_migration to copy over data from django_session table to zerver_realmsession table.
Fixes zulip#19490 and has other performance benefits. Create RealmSession model with custom fields: realm, user and ip_address, indexed by (realm, user) and ip_address. Migrate code to use that model, "zerver/lib/sessions" has most impact. Create data_migration to copy over data from django_session table to zerver_realmsession table.
Fixes zulip#19490 and has other performance benefits. Create RealmSession model with custom fields: realm, user and ip_address, indexed by (realm, user) and ip_address. Migrate code to use that model, "zerver/lib/sessions" has most impact. Create data_migration to copy over data from django_session table to zerver_realmsession table.
Fixes zulip#19490. Create RealmSession model with custom fields: realm, user and ip_address, indexed by (realm, user) and ip_address. Migrate code to use that model which results in more efficiency, for example bulk deletion of sessions in "zerver/lib/sessions". Create data_migration to copy over data from django_session table to zerver_realmsession table.
Fixes zulip#19490. Create RealmSession model with custom fields: realm, user and ip_address, indexed by (realm, user) and ip_address. Migrate code to use that model which results in more efficiency, for example bulk deletion of sessions in "zerver/lib/sessions". Create data_migration to copy over data from django_session table to zerver_realmsession table.
The
do_deactivate_user
function does what it needs to. However, the work it does is very inefficient if it's deleting a large number of users at once, asdelete_user_sessions
walks all sessions in the database once for each user that is deactivated.We should consider adding a function which is designed for bulk deactivation and only requires walking the Sessions table once.
On the flipside, deactivating a large number of users is not a common operation.
The text was updated successfully, but these errors were encountered: