diff options
author | Erik Johnston <erik@matrix.org> | 2018-08-09 10:16:16 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2018-08-09 10:16:16 +0100 |
commit | 5785b93711da5e61cb6d446d090bb7daac5d61c8 (patch) | |
tree | e7dc98431b7f52526f85439e785f58a51df89553 /synapse/storage/events.py | |
parent | Pull in necessary stores in federation_reader (diff) | |
parent | Merge pull request #3632 from matrix-org/erikj/refactor_repl_servlet (diff) | |
download | synapse-5785b93711da5e61cb6d446d090bb7daac5d61c8.tar.xz |
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/split_federation
Diffstat (limited to 'synapse/storage/events.py')
-rw-r--r-- | synapse/storage/events.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/synapse/storage/events.py b/synapse/storage/events.py index 5374796fd7..ccfda5b0fa 100644 --- a/synapse/storage/events.py +++ b/synapse/storage/events.py @@ -485,9 +485,14 @@ class EventsStore(EventFederationStore, EventsWorkerStore, BackgroundUpdateStore new_forward_extremeties=new_forward_extremeties, ) persist_event_counter.inc(len(chunk)) - synapse.metrics.event_persisted_position.set( - chunk[-1][0].internal_metadata.stream_ordering, - ) + + if not backfilled: + # backfilled events have negative stream orderings, so we don't + # want to set the event_persisted_position to that. + synapse.metrics.event_persisted_position.set( + chunk[-1][0].internal_metadata.stream_ordering, + ) + for event, context in chunk: if context.app_service: origin_type = "local" |