Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Account validity can create profile replication batches that are too big #127

Open
babolivier opened this issue Apr 4, 2022 · 0 comments

Comments

@babolivier
Copy link
Contributor

babolivier commented Apr 4, 2022

The maximum allowed size for a profile replication batch is 200 (according to Sydent), and to be safe Synapse tries to limit the size of a batch to 100 (here. The code using this limit was thought to be the only code that does bulk attribution of batch numbers, as other operations, such as (un-)hiding a profile or changing profile data for a user uses a unique batch number (ie it'll always create a batch of 1 item).

However #47 changed an account validity background job so that expired users are set to inactive in bulk. This introduced a bug, due to the fact that calling set_active with a list of user IDs will use the same batch number for all users in that list, regardless of whether this list is bigger than 100 items.

We detected this today when we noticed a batch being refused by Sydent because it was bigger than 200 items (225). Because profile replication will go away in the not-so-distant future (to be replaced with the solution described in #125), we decided to go with the hacky fix of increasing the limit on Sydent to 500 (commit). If this becomes insufficient before the new solution is in place, we will want to fix set_active to split the list of users it's given in batches of 100.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant