summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2022-04-06 14:52:39 +0100
committerGitHub <noreply@github.com>2022-04-06 13:52:39 +0000
commit6fe757d69ebbc96bf5077db88b1fd3a28c217d11 (patch)
treee011aa594c44b84b4520145e79d6b12603da6d72 /synapse/storage
parentUpdate type annotations for compatiblity with prometheus_client 0.14 (#12389) (diff)
downloadsynapse-6fe757d69ebbc96bf5077db88b1fd3a28c217d11.tar.xz
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`
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/databases/main/events.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/storage/databases/main/events.py b/synapse/storage/databases/main/events.py
index 57489c30f1..3fcd5f5b99 100644
--- a/synapse/storage/databases/main/events.py
+++ b/synapse/storage/databases/main/events.py
@@ -197,9 +197,9 @@ class PersistEventsStore:
             )
             persist_event_counter.inc(len(events_and_contexts))
 
-            if stream < 0:
-                # backfilled events have negative stream orderings, so we don't
-                # want to set the event_persisted_position to that.
+            if not use_negative_stream_ordering:
+                # we don't want to set the event_persisted_position to a negative
+                # stream_ordering.
                 synapse.metrics.event_persisted_position.set(stream)
 
             for event, context in events_and_contexts: