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

Commit 6fe757d

Browse files
authored
Fix synapse_event_persisted_position metric (#12390)
Fixes a bug introduced in #11417 where we would only included backfilled events in `synapse_event_persisted_position`
1 parent ae01a7e commit 6fe757d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

changelog.d/12390.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix a bug introduced in Synapse 1.49.0 which caused the `synapse_event_persisted_position` metric to have invalid values.

synapse/storage/databases/main/events.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,9 @@ async def _persist_events_and_state_updates(
197197
)
198198
persist_event_counter.inc(len(events_and_contexts))
199199

200-
if stream < 0:
201-
# backfilled events have negative stream orderings, so we don't
202-
# want to set the event_persisted_position to that.
200+
if not use_negative_stream_ordering:
201+
# we don't want to set the event_persisted_position to a negative
202+
# stream_ordering.
203203
synapse.metrics.event_persisted_position.set(stream)
204204

205205
for event, context in events_and_contexts:

0 commit comments

Comments
 (0)