Deletes on Client DB after an Initial sync #1079
Replies: 1 comment 5 replies
-
Thanks for your detailed explanation.
Is it correct ? |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We’re seeing what we think is kind of strange behavior after the initial sync. Our environment is as such, we are running two Postgres databases, one of them is the “server” and the other is the “client”. We have two instances of Dotmim.Sync running, one on the same machine as the server database and the other on the same machine as the client database – at the moment we’re not using the WebRemoteOrchestrator but rather RemoteOrchestrator and LocalOrchestrator. Both copies of our code running DotMim.Sync have the “RemoteOrchestrator” pointing at what we’re calling the Server Database and the “LocalOrchestrator” pointing at what we’re calling the Client Database. The initial sync is being initiated from the DotMim.Sync instance that is running on the same machine as the Server Database. After an initial sync, which provisions both databases, we see that the “Client” database has tracking tables with data in it, but the “Server” database has empty tracking tables. Is this the expected behavior?
If this is the expected behavior, then what we’re seeing is after the initial sync, any data that is deleted from the client database but has been present on the server database during the initial sync does not get deleted after the client database has deleted it and another sync is performed. Instead we see a RemoteIsDeletedLocalNotExist conflict raised by the RemoteOrchestrator (pointing at the Server Database), showing that the remote row (Client Database) is in the client database tracking table marked as deleted, but there is no corresponding Local row (Server Database) in the server database tracking table. We see this conflict raised regardless of whether we execute the subsequent sync (the sync after the initial sync) on the copy of code using DotMim.Sync running on the same machine as the server database or the same machine as the client database.
As a work-around, we’ve found that copying the client database’s tracking table rows where sync_row_is_tombstone = 1 and then adding them to the corresponding server database’s tracking table and setting sync_row_is_tombstone = 0 allows for the deletes to be synced over after executing the subsequent sync.
Beta Was this translation helpful? Give feedback.
All reactions