Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Move to using TCP replication #2097
Conversation
erikjohnston
added some commits
Mar 27, 2017
erikjohnston
requested a review
from richvdh
Apr 4, 2017
erikjohnston
assigned
erikjohnston and
richvdh
and unassigned
erikjohnston
Apr 4, 2017
| - pass | ||
| + def __init__(self, db_conn, hs): | ||
| + super(FederationSenderSlaveStore, self).__init__(db_conn, hs) | ||
| + self.federation_out_pos_startup = self._get_federation_out_pos(db_conn) |
richvdh
Apr 4, 2017
Member
why do we need to store this rather than let the handler just call get_federation_out_pos?
erikjohnston
Apr 4, 2017
Owner
As we always want to have the position available rather than having to jump through a deferred the first time round. This is the same as what we do with all the ID generators too, we fetch them out of the database during start up
| - yield self.store.update_federation_out_pos( | ||
| - "federation", latest_id | ||
| - ) | ||
| + self.update_token(token) |
| + super(PusherReplicationHandler, self).on_rdata(stream_name, token, rows) | ||
| + self.poke_pushers(stream_name, token, rows) | ||
| + | ||
| + def poke_pushers(self, stream_name, token, rows): |
richvdh
Apr 4, 2017
Member
might be easier to make this defer.inlineCallbacks and preserve_fn when calling it?
| + def start_pusher(self, user_id, app_id, pushkey): | ||
| + key = "%s:%s" % (app_id, pushkey) | ||
| + logger.info("Starting pusher %r / %r", user_id, key) | ||
| + return self.pusher_pool._refresh_pusher(app_id, pushkey, user_id) |
richvdh
Apr 4, 2017
Member
this seems to be returning a deferred which is dropped. Should there be a preserve_fn somewhere?
richvdh
assigned
erikjohnston
and unassigned
richvdh
Apr 4, 2017
erikjohnston
assigned
richvdh
and unassigned
erikjohnston
Apr 4, 2017
richvdh
approved these changes
Apr 4, 2017
I guess it's plausible? Can't promise it won't break things.
erikjohnston commentedApr 4, 2017
•
edited
This is a continuation of #2082
Sytest branch: matrix-org/sytest#351