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

Incredible slow sync due to interrupted storing #376

Closed
giomfo opened this issue Jun 8, 2016 · 3 comments
Closed

Incredible slow sync due to interrupted storing #376

giomfo opened this issue Jun 8, 2016 · 3 comments
Assignees
Labels
P1 T-Enhancement New features, changes in functionality, performance boosts, user-facing improvements
Milestone

Comments

@giomfo
Copy link
Member

giomfo commented Jun 8, 2016

Matthew complains on incredible slow sync, this appends when the previous saving was interrupted.

Notify the user should be useful here

@giomfo giomfo added T-Enhancement New features, changes in functionality, performance boosts, user-facing improvements P1 labels Jun 8, 2016
@giomfo giomfo added this to the sprint3 milestone Jul 8, 2016
@giomfo giomfo changed the title Notify the user when the local storage is reset to fix file corruption. Incredible slow sync due to interrupted storing Jul 8, 2016
@giomfo
Copy link
Member Author

giomfo commented Jul 8, 2016

We suggest keeping the existing storage until the end of the saving process.
The application should write the new data by creating new files, the existing storage will be replaced at the end of the saving.
If the saving is interrupted, the existing storage will be used to restore the local storage.

The saving process may still be interrupted when the existing storage is replaced, but this operation is faster. The probability to detect a corrupted storage should be reduced.

We still need to notify the user when the local storage is reset to fix file corruption.

@giomfo giomfo modified the milestones: sprint2.1, sprint3 Jul 12, 2016
@giomfo giomfo self-assigned this Jul 13, 2016
@giomfo giomfo modified the milestones: sprint2.2, sprint2.1 Jul 15, 2016
@ara4n
Copy link
Member

ara4n commented Jul 27, 2016

Brief notes from talking to @manuroe about this on Monday:

I think we can fake atomic saves with rollback without having to resync the world, and without switching to using realm.io or similar:

  • persist per-room events/state to: ./messages/!curbaf:matrix.org-${previous_sync_token}.
  • rename the file for the room after persisting them to replace the original
  • if things crash during peristence, then on launch:
    • look for partially any persisted files with the -${previous_sync_token} suffix
    • load up all the existing non-partial files
    • start /sync-ing again from the $previous_sync_token in the partial filename.

If there were local echos being persisted in the partial file, then they will obviously get lost when resyncing from /sync results, but c'est la vie.

manuroe added a commit to matrix-org/matrix-ios-sdk that referenced this issue Aug 12, 2016
manuroe added a commit to matrix-org/matrix-ios-sdk that referenced this issue Aug 12, 2016
manuroe added a commit to matrix-org/matrix-ios-sdk that referenced this issue Aug 12, 2016
manuroe added a commit to matrix-org/matrix-ios-sdk that referenced this issue Aug 16, 2016
manuroe added a commit to matrix-org/matrix-ios-sdk that referenced this issue Aug 16, 2016
manuroe added a commit to matrix-org/matrix-ios-sdk that referenced this issue Aug 16, 2016
@manuroe manuroe closed this as completed Aug 16, 2016
@manuroe
Copy link
Member

manuroe commented Aug 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 T-Enhancement New features, changes in functionality, performance boosts, user-facing improvements
Projects
None yet
Development

No branches or pull requests

3 participants