Ouch, data sync his close to home for me. That was my first job. Not an easy problem at all.
Tip for those of you with the same problem, if you can, try to sync both the data and the actions taken to produce the data (event sourcing) and try to eliminate sources of indeterminism.