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

disable LL for incr syncs, and log incr sync stats #3840

Merged
merged 8 commits into from
Sep 11, 2018
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/3840.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Disable lazy loading for incremental syncs for now
22 changes: 20 additions & 2 deletions synapse/handlers/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,13 @@ def compute_state_delta(self, room_id, batch, sync_config, since_token, now_toke
lazy_load_members=lazy_load_members,
)
elif batch.limited:
# for now, we disable LL for gappy syncs - see
# https://github.com/vector-im/riot-web/issues/7211#issuecomment-419976346
# N.B. this slows down incr syncs as we are now processing way
# more state in the server than if we were LLing.
types = None
filtered_types = None

state_at_previous_sync = yield self.get_state_at(
room_id, stream_position=since_token, types=types,
filtered_types=filtered_types,
Expand All @@ -756,13 +763,14 @@ def compute_state_delta(self, room_id, batch, sync_config, since_token, now_toke
timeline_start=state_at_timeline_start,
previous=state_at_previous_sync,
current=current_state_ids,
# we have to include LL members in case LL initial sync missed them
lazy_load_members=lazy_load_members,
)
)
else:
state_ids = {}
if lazy_load_members:
if types:
# We're returning an incremental (or initial) sync, with no
# We're returning an incremental sync, with no
# "gap" since the previous sync, so normally there would be
# no state to return.
# But we're lazy-loading, so the client might need some more
Expand Down Expand Up @@ -1681,6 +1689,16 @@ def _generate_room_entry(self, sync_result_builder, ignored_users,
unread_notifications["highlight_count"] = notifs["highlight_count"]

sync_result_builder.joined.append(room_sync)

if batch.limited:
user_id = sync_result_builder.sync_config.user.to_string()
logger.info(
"Incremental syncing room %s for user %s with %d state events" % (
room_id,
user_id,
len(state),
)
)
elif room_builder.rtype == "archived":
room_sync = ArchivedSyncResult(
room_id=room_id,
Expand Down