On Di, 2010-02-02 at 11:23 +0000, Lukas Zeller wrote:
> We could check at syncagent.cpp:1171 if the abort reason status is
> zero (i.e. ABORTDATASTORE(0) called), and if so behave differently,
> i.e. just muting that datastore, but leave the sessing running. But as
> said, I'm not sure that will help with many servers.

ABORTDATASTORE(0) would lead to the engine picking some other, generic
status (514). I solved this by introducing a specific status code that
tells the engine "abort this store, but continue with the rest". The
SyncEvolution takes care of actually aborting the session, as before.

Not pushed to git yet. Patch attched. If that approach looks right, I'll
merge the Synthesis master branch with the fix for ABORTDATASTORE() and
add my own patch on top (or you include it).

Now, for the server side things are bit more tricky. First of all, is
there any way how the caller of the engine can determine the status of
each source, as it can for a client via the progress events? The lack of
progress events in the server is already a big problem for interactive
monitoring of a running server session, but not getting information
about per-source failures affects our error handling and reporting.

Second, datastoreinitscript is apparently called when the server
processes the "Sync" command. There is only one Sync command in that
message, so the client-side trick of processing the whole message to
determine the sync mode for all stores doesn't work. Hooking into the
processing of the Status response of the client for the server's Alert
won't work either, because someone client and server also only send
Alert and Status for one store per message.

When the client alerts the server, there are two Alerts in the message.
Then the server replies with an Alert for only one of the stores. Why is
that? Couldn't it include two Alerts in the same reply?

Finally, on the server side we typically don't know whether the user has
chosen a slow sync mode intentionally. He might have. So we can only
enable the slow sync detection for server-initiated syncs were we
control the sync mode. This problem can be solved, for example by only
enabling the slow sync detection in configs where the server initiates
the connection or by making it conditional on having sent a SAN.

-- 
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 69e9cb73277a0e6e371ca4783ae617a9446be9db Mon Sep 17 00:00:00 2001
From: Patrick Ohly <[email protected]>
Date: Thu, 4 Feb 2010 22:13:54 +0100
Subject: [PATCH] LOCERR_DATASTORE_ABORT: abort store, not session

Calling ABORTDATASTORE() normally aborts the whole session.
Passing the new LOCERR_DATASTORE_ABORT avoids that. However,
servers might get confused when a client stops sending information
about one store, so someone using this special status code
should better know what they are doing...
---
 src/sysync/syncagent.cpp         |   12 +++++++-----
 src/sysync_SDK/Sources/syerror.h |    6 ++++++
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/src/sysync/syncagent.cpp b/src/sysync/syncagent.cpp
index 1c9c82d..af9633d 100755
--- a/src/sysync/syncagent.cpp
+++ b/src/sysync/syncagent.cpp
@@ -1164,12 +1164,14 @@ localstatus TSyncAgent::NextMessage(bool &aDone)
           	// prepare engine for sync (%%% new routine in 3.2.0.3, summarizing engInitForSyncOps() and
             // switching to dssta_dataaccessstarted, i.e. loading sync set), but do in only once
             if (!((*pos)->testState(dssta_syncsetready))) {
-            	// not yet started
-	          	status = (*pos)->engInitForClientSync();
-	            if (status!=LOCERR_OK) {
+              // not yet started
+              status = (*pos)->engInitForClientSync();
+              if (status!=LOCERR_OK ) {
                 // failed
-                AbortSession(status,true);
-                return getAbortReasonStatus();
+                if (status!=LOCERR_DATASTORE_ABORT) {
+                  AbortSession(status,true);
+                  return getAbortReasonStatus();
+                } 
               }
             }
             // start or continue (which is largely nop, as continuing works via unfinished sync command)
diff --git a/src/sysync_SDK/Sources/syerror.h b/src/sysync_SDK/Sources/syerror.h
index 5072d6d..09a6f66 100644
--- a/src/sysync_SDK/Sources/syerror.h
+++ b/src/sysync_SDK/Sources/syerror.h
@@ -157,6 +157,12 @@ enum TSyErrorEnum {
   LOCERR_BADURL = 20046,
   /** server not found */
   LOCERR_SRVNOTFOUND = 20047,
+  /**
+   * ABORTDATASTORE() parameter to flag the current datastore as bad
+   * without aborting the whole session. Exact reason for abort depends
+   * on caller of that macro.
+   */
+  LOCERR_DATASTORE_ABORT = 20048,
 
   /** cURL error code */
   LOCERR_CURL = 21000,
-- 
1.6.5

_______________________________________________
os-libsynthesis mailing list
[email protected]
http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis

Reply via email to