Change the default conflict resolution policy.
* The default conflict resolution policy now picks the most recent
of the two conflicting mutations. A UTC timestamp is added to
each mutation when it reached syncd, and is used to select the
winner of a conflict. The mutation version numbers are now used
as a tie-breaker when the two mutations have the same timestamp.
* Change the default peerSyncInterval to 100ms. For testing, add
a command-line arg to override this value.
Change-Id: Ie1263afb85cecf65873fb41054c424044401974b
diff --git a/runtimes/google/vsync/vsync.idl.go b/runtimes/google/vsync/vsync.idl.go
index a1958a5..fdbc33e 100644
--- a/runtimes/google/vsync/vsync.idl.go
+++ b/runtimes/google/vsync/vsync.idl.go
@@ -33,6 +33,8 @@
type LogValue struct {
// Mutation is the store mutation representing the change in the object.
Mutation raw.Mutation
+ // SyncTime is the timestamp of the mutation when it arrives at the Sync server.
+ SyncTime int64
// Delete indicates whether the mutation resulted in the object being
// deleted from the store.
Delete bool
@@ -270,6 +272,7 @@
_gen_wiretype.StructType{
[]_gen_wiretype.FieldType{
_gen_wiretype.FieldType{Type: 0x51, Name: "Mutation"},
+ _gen_wiretype.FieldType{Type: 0x25, Name: "SyncTime"},
_gen_wiretype.FieldType{Type: 0x2, Name: "Delete"},
_gen_wiretype.FieldType{Type: 0x2, Name: "Continue"},
},