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

Commit

Permalink
Reduce replication traffic due to reflected cache stream POSITION
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston committed Oct 26, 2023
1 parent c14a7de commit 7a4aacd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion synapse/replication/tcp/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from synapse.replication.tcp.commands import PositionCommand
from synapse.replication.tcp.protocol import ServerReplicationStreamProtocol
from synapse.replication.tcp.streams import EventsStream
from synapse.replication.tcp.streams._base import StreamRow, Token
from synapse.replication.tcp.streams._base import CachesStream, StreamRow, Token
from synapse.util.metrics import Measure

if TYPE_CHECKING:
Expand Down Expand Up @@ -205,6 +205,13 @@ async def _run_notifier_loop(self) -> None:
# send, so we send a `POSITION` to inform other
# workers of the updated position.

# We skip this for the `caches` stream as a) it
# generates a lot of traffic as every worker would
# echo each write, and b) nothing cares if a given
# worker's caches stream position lags.
if stream.NAME == CachesStream.NAME:
continue

# Note: `last_token` may not *actually* be the
# last token we sent out in a RDATA or POSITION.
# This can happen if we sent out an RDATA for
Expand Down

0 comments on commit 7a4aacd

Please sign in to comment.