This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 3
Performance improvements to marking expired users as inactive #47
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Additionally, change it to accept UserIDs objects.
c5f7ad6
to
805aa10
Compare
Additionally, have it return UserID objects as the only caller of this method did this.
805aa10
to
27dfc4c
Compare
anoadragon453
commented
Jun 17, 2020
babolivier
suggested changes
Jun 19, 2020
Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
anoadragon453
commented
Jun 19, 2020
…ctory So that it also checks that a initial profile is replicated first.
babolivier
approved these changes
Jun 19, 2020
Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
INSTR is not available in postgres :(
…ix-org/synapse-dinsic into anoa/mark_expired_users_active_perf * 'anoa/mark_expired_users_active_perf' of github.com:matrix-org/synapse-dinsic: Update tests/utils.py
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a performance-related improvement to #13, which queried and hid active and already inactive users, one-by-one. This PR updates the code to query only active, expired users, all at once, and then mark them as inactive, all at once.
While writing this PR, I also noticed that we were querying the database usingUserID
s in theprofiles
table. While the columnuser_id
in theprofiles
table probably should use full, qualified user IDs, in practice in unfortunately uses localparts.However, the code in #13 looked to have assumed that it contained full user IDs. This PR corrects that, but it is uncertain at this point of how it will interact with existing databases.Edit: While we do use localparts in a column titled
user_id
, localparts were correctly extracted both when querying and inserting. This PR just intends to make things clearer.Best to be reviewed commit-by-commit.