On Thu, 2011-09-15 at 18:14 +0200, Lukas Zeller wrote:
> On Sep 12, 2011, at 14:16 , Patrick Ohly wrote:
> 
> > On Sa, 2011-09-10 at 12:32 +0200, Lukas Zeller wrote:
> >> Hello Patrick,
> >> 
> >> On Sep 7, 2011, at 14:53 , Patrick Ohly wrote:
> >> But what we could do is allow StartDataRead to return 508 error code
> >> to have the engine reset sync anchors before bailing out, such that
> >> the next session would become a slow sync.
> >> 
> >> Would that solve the problem?
> > 
> > It is sub-optimal because it will be visible to users. Currently
> > SyncEvolution doesn't automatically start a new sync. This will also
> > break the automated testing, which will bail out with that error instead
> > of doing a slow sync.
> > 
> > As one way of dealing with the problem adding such a special error code
> > is worthwhile. But perhaps there is a different way?
> > 
> > For example, could the datastore API extended with a "verify anchor"
> > call which is called soon enough to discard the anchor and fall back to
> > a slow sync?
> 
> Officially adding API calls is very complicated due to the indirect
> way the plugin ABI is designed with all the up/downwards compatibilty.
> At least, I can't do that efficiently myself :-(
> 
> But I think I found a better way to do the same, by simply allowing
> StartDataRead() to happen earlier - in time to cause a slow sync if
> needed.

Your patched worked fine, after fixing one minor aspect. See attached
patch.

This will allow me to close BMC #22881 after merging into the master
branches. In the case of libsynthesis I probably should catch up with
your latest published branch, too.

Right now I am still cherry-picking into the version used by the stable
SyncEvolution 1.2 branch, but this becomes harder because of some
whitespace cleanup that you must have done in your upstream branch.

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.

>From 900726043cca2b260308bedb15f4ed292763b81c Mon Sep 17 00:00:00 2001
From: Patrick Ohly <patrick.o...@intel.com>
Date: Wed, 12 Oct 2011 09:35:17 +0200
Subject: [PATCH] engine: fixed handling of 508

After detecting the special 508 "request slow sync" error, the
LOCERR_OK must be returned to the higher levels in the stack,
otherwise syncing aborts.
---
 src/sysync/customimplds.cpp |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/sysync/customimplds.cpp b/src/sysync/customimplds.cpp
index 6a44f47..2d18f69 100755
--- a/src/sysync/customimplds.cpp
+++ b/src/sysync/customimplds.cpp
@@ -1623,6 +1623,7 @@ localstatus TCustomImplDS::implMakeAdminReady(
           // special case: the database requests a slow sync for internal reasons (like change tracking disabled)
           // - force slow sync by removing last anchor
           fLastRemoteAnchor.erase();
+          sta = LOCERR_OK;
         }
       }
     } // if apiLoadAdminData successful
-- 
1.7.2.5

_______________________________________________
os-libsynthesis mailing list
os-libsynthesis@synthesis.ch
http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis

Reply via email to