Hi Congwu,

On Aug 14, 2009, at 3:27 , Chen, Congwu wrote:

If I understand correctly, the existing code has a bug in implGetItem:

The assumption: "records detected new/changed now will inevitably be
new or changed in all other profiles" seems to me not reasonable. Please
correct me if I lost something.

The assumption is correct because a sync remains resumable only if no other profile is synced in between (should be that way, see update below). This is because the implementation cannot hold resume states for more than one profile (e.g. the chgl_markedforresume flag would need to be per profile). This is of course a compromise, but I considered that acceptable.

Because of this, your sample scenario cannot happen as described

Suppose we have record K and server A,B
1. sync with A, suspended.
2. K gets updated.
3. sync with B, K.syncmod=3, sending K.

At this time, syncing B will cause suspend status for A to be discarded.

4. sync with A, resume, K.syncmod=5

A will not be able to resume, but do a normal sync, and thus will not update K.syncmod.

5. sync with B, K will be resended.

Because it was not updated in 4, K will not be resent.


Update: I found you are still right, because there seems to be an implementation problem - the resume status of other profiles is not cleared when a session completes ok. The idea was probably that the resume state gets lost only when another profile's sync does not successfully end, but after a quick review I guess this cannot work properly. I also found that there might be a problem with pendingmaps and multiple profile syncs, because these should be kept on a per profile basis because these are needed not only in resumes, but normal syncs as well.

I guess I'll have to do a more thorough review and cleanup of that code under the aspect of multi-profiles.

Thanks a lot for your close observation and revealing the problem!

For single profile use, the code is still safe, IMHO.

Lukas Zeller ([email protected])
-
Synthesis AG, SyncML Solutions  & Sustainable Software Concepts
[email protected], http://www.synthesis.ch





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

Reply via email to