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

Reduce DB hits for replication #1141

Merged
merged 3 commits into from
Oct 11, 2016
Merged

Reduce DB hits for replication #1141

merged 3 commits into from
Oct 11, 2016

Conversation

erikjohnston
Copy link
Member

Some streams will occaisonally advance their positions without actually
having any new rows to send over federation. Currently this means that
the token will not advance on the workers, leading to them repeatedly
sending a slightly out of date token. This in turns requires the master
to hit the DB to check if there are any new rows, rather than hitting
the no op logic where we check if the given token matches the current
token.

This commit changes the API to always return an entry if the position
for a stream has changed, allowing workers to advance their tokens
correctly.

Some streams will occaisonally advance their positions without actually
having any new rows to send over federation. Currently this means that
the token will not advance on the workers, leading to them repeatedly
sending a slightly out of date token. This in turns requires the master
to hit the DB to check if there are any new rows, rather than hitting
the no op logic where we check if the given token matches the current
token.

This commit changes the API to always return an entry if the position
for a stream has changed, allowing workers to advance their tokens
correctly.
@NegativeMjark
Copy link
Contributor

LGTM apart from the Unit Test failures.

@NegativeMjark
Copy link
Contributor

LGTM

@erikjohnston erikjohnston merged commit e641115 into develop Oct 11, 2016
@richvdh richvdh deleted the erikj/replication_noop branch December 1, 2016 14:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants