I just don't know what to search for and the searches I've tried all come up with unrelated issues.
C#, .Net 4.5, MSSQL 2008 R2
Setup: We are in a push only peer-to-peer situation where a data change leads to an event that sends a WebAPI notification to other peers, who then pull those changes (as opposed to the local pushing the changes to the remotes).
Here's what's happening: Two events happen about half a second apart that cause two sets of 15 records to be created in the sync table. Both events cause a WebAPI call to a remote that cause that remote to start the MSSFX process with the originating peer. What we're finding is that the first MSSFX sync is downloading more than 15 records, and the second is downloading the remaining, except occasionally it misses one. For example, we create 30 new records in two groups of 15; the first sync downloads 22 records, the second sync only downloads 7. The missing record is never downloaded unless it changes later.
My Theory: I think what is happening is that the first process is downloading 22 objects, but then as a separate transaction, retrieves the knowledge containing 23 objects. Then on the second sync, it doesn't "see" the extra object, and only gets the 7 objects for the next knowledge state.
So my question is: is there something I'm doing wrong? Is there a way to make it transactional so I don't have to worry about the knowledge not matching the data? Am I off base on my guess and that's not how it works at all?
To be clear: when I say downloaded, I mean the stats class the Synchronize method returns claims that number, and the sync database agrees, only 29 rows exists in the local while 30 exist in the remote.
UPDATE I may have found the answer from this stack overflow question: How to make sure synchronization using the Microsoft Sync Framework was successful?
It looks like we're not on the newest version and there was a hotfix for concurrency issues. If this turns out to be it I'll add it as an answer. Not sure if it should be marked as a duplicate; I would have never found the above question if I hadn't been going through all "Microsoft Sync Framework" tagged questions one-by-one. But I defer to the veterans of the site.
UPDATE 2 That was it. I can run the same test now and nothing gets dropped.