-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Limit cache invalidation replication line length #4748
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes
synapse/storage/_base.py
Outdated
# We need to be careful that the size of the `members_changed` list | ||
# isn't so large that it causes problems sending over replication, so we | ||
# send them in chunks. | ||
members_changed = list(members_changed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you want synapse.util.batch_iter
here.
synapse/storage/_base.py
Outdated
# isn't so large that it causes problems sending over replication, so we | ||
# send them in chunks. | ||
members_changed = list(members_changed) | ||
for i in range(0, len(members_changed), 100): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
given that mxids have a maxlen of 255 chars, we can still easily overflow the max line length of 16K
Codecov Report
@@ Coverage Diff @@
## develop #4748 +/- ##
===========================================
- Coverage 75.12% 75.11% -0.01%
===========================================
Files 340 340
Lines 34860 34867 +7
Branches 5711 5713 +2
===========================================
+ Hits 26188 26190 +2
- Misses 7058 7062 +4
- Partials 1614 1615 +1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TOTES FINE
Hopefully fixes #4733 |
This fixes a bug where replication completely wedges if the server tries to send a cache invalidation that serialises to a line that is longer than the max line length.
Introduced in #4671