Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace continuous replication with periodic replication #4805

Closed
4 tasks
garethbowen opened this issue Aug 30, 2018 · 8 comments
Closed
4 tasks

Replace continuous replication with periodic replication #4805

garethbowen opened this issue Aug 30, 2018 · 8 comments
Labels
Priority: 2 - Medium Normal priority Type: Performance Make something faster

Comments

@garethbowen
Copy link
Member

garethbowen commented Aug 30, 2018

As discussed in this document replace continuous replication with periodic one-shot replication to improve server scalability, phone battery usage, network data usage, and reduce code complexity.

  • Implement polling to do a bidirectional replication every 5 minutes. The specific number is up for debate but 5 minutes is a safe place to start.
  • Implement Trigger a db sync when clicking on the sync status button #3976 so users can manually trigger a bidirectional sync.
  • Investigate using online event handlers to trigger a bidirectional sync when a user comes back online if it's been longer than the 5 minute timer above.
  • Remove continuous replication code from the API changes endpoint.
@kennsippell
Copy link
Member

@SCdF @dianabarsan Would either of you be able to give an overview of the work required for this bullet Remove continuous replication code from the API changes endpoint?

@SCdF
Copy link
Contributor

SCdF commented Oct 4, 2018

@kennsippell I'm not sure that should actually be there honestly, because then I don't think upgrades would work? I think we need to support continuous replication in api until we're confident (or we force everyone) onto a version that no longer does it.

@SCdF
Copy link
Contributor

SCdF commented Oct 4, 2018

(to be clear we should make a note to do it, but it would be in a "4.0.0" ticket or whatever)

@kennsippell
Copy link
Member

kennsippell commented Oct 4, 2018

Sounds good! I broke that piece off into a separate issue ^.

@garethbowen
Copy link
Member Author

Kenn is working on it - I've assigned myself so nobody else picks it up.

@ngaruko
Copy link
Contributor

ngaruko commented Dec 17, 2018

Any clue on how to AT this @garethbowen ? Thanks.

@garethbowen
Copy link
Member Author

@ngaruko In previous versions if you made a change on the server then it would get replicated to the browser almost immediately because there was a continuous connection to the server. Now it will take up to five minutes because we check once and then close the connection. So to AT:

  1. Log in as a restricted user and load a specific report.
  2. Check the network tab - there should be no continuous requests. Everything should eventually complete.
  3. In a separate browser log in as an admin and make a change to the doc selected in 1.
  4. Keep watching the network tab until you see a changes request go out. Make sure this request completes in a reasonable time. Then make sure the doc is updated with your change without having to refresh the browser.

The next checkpoint about the "sync now" button should be tested in the linked issue.

The third part about online event handlers can be tested by...

  1. Disconnect the browser from the internet
  2. Waiting six minutes - make sure no changes requests are sent in that time
  3. Reconnect to the internet - make sure a changes request goes out soon after reconnecting.

@ngaruko
Copy link
Contributor

ngaruko commented Jan 8, 2019

LGTM
Tested on gamma.dev v 3.4

@ngaruko ngaruko closed this as completed Jan 8, 2019
@garethbowen garethbowen changed the title Replace continuous replication Replace continuous replication with periodic replication Feb 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: 2 - Medium Normal priority Type: Performance Make something faster
Projects
None yet
Development

No branches or pull requests

4 participants