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

Commit 1bc9985

Browse files
author
David Robertson
authored
Have replication clients remove _INT_STREAM_POS (#15309)
* Have replication clients remove _INT_STREAM_POS Suppose worker A makes an internal http request from worker B. B may make changes that A later learns about over replication. We want A's request to block until it has seen those changes—mainly to ensure A's caches are invalidated promptly. This helps provide read-after-write consistency, eliminating entire categories of races and test flakes. To implement this, B includes a top-level field `_INT_STREAM_POS` in its response JSON. Roughly speaking, the field's value tells A what to wait for. But we weren't removing that internal field before A's request completed! Introduced in #14820. Fixes #15308. * Changelog
1 parent 72f3f23 commit 1bc9985

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

changelog.d/15309.bugfix

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix a bug introduced in Synapse 1.76.0 where responses from worker deployments could include an internal `_INT_STREAM_POS` key.

synapse/replication/http/_base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ async def send_request(*, instance_name: str = "master", **kwargs: Any) -> Any:
345345
_outgoing_request_counter.labels(cls.NAME, 200).inc()
346346

347347
# Wait on any streams that the remote may have written to.
348-
for stream_name, position in result.get(
348+
for stream_name, position in result.pop(
349349
_STREAM_POSITION_KEY, {}
350350
).items():
351351
await replication.wait_for_stream_position(

0 commit comments

Comments
 (0)