question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bidirectional sync robustness

See original GitHub issue

Up to version 2.1, rclonesync has used a sync process that makes Path1 the perfect copy, and then uses rclone sync to replicate Path1 to Path2. The changes on Path2 are identified and then individually copied to Path1 (or deleted on Path1 if the file was deleted on Path2). This process flow works great when the changes are infrequent. The issue is when there are changes on the filesystems during the rclonesync run. In certain circumstances the new changes will be lost - see orange labels in pictures and the tables.

Changes are proposed for rclonesync’s process flow to lessen the chance of data loss. Please provide your thoughts and feedback on this proposal.

V2.1 and prior sync process flow

image

Sync robustness and risk of data loss in the V2.1 process flow

Changed at Handling Status
A only - Normal case File copied from Path2 to Path1. Good
A and B - Changed again after initially identified as changed B version copied to Path1 and captured correctly in the Final LSLs. Good
B only or F only - Not identified at A Change will be lost in the final rclone sync Path1 to Path2.  Path1 version survives. Data loss.
C only Change will be copied from Path1 to Path2 by the final rclone sync. Good.
A and (D or E) - Changed during file copy or sync operations File access conflict.  rclone will retry.  Change at destination will be lost.  Source version survives. Possible Critical Error Abort
A and F - Changed after copy Path2 to Path1 F change will be lost in the final rclone sync Path1 to Path2.  A version survives. Data loss
G only Change will be copied to Path2 in the next rclonesync run. Good.  Out of sync until next run.
A and H H version captured in Path2 Final LSL and not identified as a delta on the next run.  The next run will push the Path1 version to Path2, losing the H version. Out of sync until next run.  Data loss on next run.

V2.2 proposed new sync process flow

The picture shows handling of changes identified at time A on Path2. With the V2.2 process flow the Path1 handling would be the same as the Path2 handling, so just switch Path1 and Path2 in the drawing. This sync process might be faster as it eliminates the rlcone sync operation, which I suspect contains its own rclone lsl operations. image

Sync robustness and risk of data loss in the V2.2 process flow

Changed at Handling status
A only - Normal case File copied from Path2 to Path1. Good
B only or C only - Changed after initial LSLs Change is missed.  File not copied. Good. Out of sync until next run.
A and C - Changed on Path1 after identified as changed on Path2 Path2 version survives.  Path1 version is lost. Data loss
A and (D or E) - Changed or deleted during actual copy File access conflict.  rclone will retry.  Likely E version is lost and D version survives. Possible Critical Error Abort
A and (F or G) - Changed after copy. Identified as different in the two Final LSLs.  Earlier version saved in both Tracking LSLs. Will be caught in next sync run
A and B - B version copied but rclonesync is unaware that it copied B version.  B version identified in Final LSL and updated in Path1 and Path2 Tracking LSLs. Good

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:22 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
Jwink3101commented, May 9, 2019

Just a followup to my post, I added rclone to my tool if you want to compare methodologies. I am not saying mine is better. It is just an alternative approach that may be of interest to you. It was also not written originally with rclone in mind so that brings its own limitations.

Best of luck on yours!

0reactions
cjnazcommented, Sep 2, 2020

Please continue the issue/discussion in #59

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bidirectional Data Sync: What it is and How it Works
Bidirectional synchronization allows every team member across a company to operate off the same set of up-to-date and accurate data and ...
Read more >
How Does One-Way vs Two-Way Data Synchronization Work?
Users of bi-directional syncing should consider a robust platform synchronization tool to help administrators easily configure a sync between ...
Read more >
Bidirectional synchronization: what it is and 3 examples that ...
A bidirectional sync between your CRM and marketing automation platform neatly solves this issue, as it enables marketers and sales reps to view...
Read more >
Principles of Robust Timing over the Internet - ACM Queue
In a bidirectional synchronization paradigm, which we focus on here (the alternative is to broadcast from the server only), timing packets ...
Read more >
(PDF) A Synchronization Approach Based on Bidirectional ...
Due to the noise-like and aperiodic characteristics of chaotic signals, the synchronization of CD3S signals is a challenging issue. A ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found