Hello Patrick,
On Oct 23, 2009, at 14:52 , Patrick Ohly wrote:
I'm not exactly sure how I got my server data into such a state, but I
ended up with entries in my local to remote ID map which only had a
local ID.
This is a perfectly normal intermediate state - these are "unconfirmed
add" entries waiting for a <Map> command from the client. The map
entry's flags will have a bit flag set for this state.
Any compliant client (since SyncML 1.0) will send the missing map at
the beginning of the next session. But the server must know these were
sent already to the client to avoid duplicates.
As a result, the server sends these items to the peer [...]
Hmmm. The presence of the "unconfirmed add" map entry should prevent
that. Maybe something else went wrong.
[...] and then tries to update the map.
It updates SOME bits of the map entry for many operations, and after
every processed request, so I can't tell without a detailed log
anyalysis (exotic logging on...) what's happening here. But that's
apparently not the point anyway.
It does that with insertMapItem():
That's the point - from a look I just had in pluginapids.cpp's
apiSaveAdminData() it should not do any updates with InsertMapItem().
If it really does, that would be a bug.
Note however that you cannot use the localID alone as primary key to
the maps, as there might be valid cases when there are multiple
entries for the same localid (but with different entrytype/ident).
#6 0x00000000006163f9 in SyncEvolution_InsertMapItem
(aContext=0x15b2210, mID=0x7fff4e576bf0)
at /home/patrick/projects/syncevolution/src/syncevo/
SynthesisDBPlugin.cpp:510
#7 0x00000000006a1f29 in sysync::TDB_Api::InsertMapItem
(this=0x15bd1a8, mID=0x7fff4e576bf0)
at /home/patrick/projects/libsynthesis/src/DB_interfaces/api_db/
dbapi.cpp:1558
#8 0x000000000078121c in sysync::TPluginApiDS::apiSaveAdminData
(this=0x15bc1c0,
aDataCommitted=false, aSessionFinished=false)
at /home/patrick/projects/libsynthesis/src/DB_interfaces/api_db/
pluginapids.cpp:1768
#9 0x0000000000796ef1 in sysync::TCustomImplDS::SaveAdminData
(this=0x15bc1c0, aSessionFinished=false, aSuccessful=false)
at /home/patrick/projects/libsynthesis/src/sysync/customimplds.cpp:
2957
#10 0x0000000000797044 in sysync::TCustomImplDS::implSaveResumeMarks
(this=0x15bc1c0)
at /home/patrick/projects/libsynthesis/src/sysync/customimplds.cpp:
3101
#11 0x000000000075c49a in sysync::TStdLogicDS::logicSaveResumeMarks
(this=0x15bc1c0)
at /home/patrick/projects/libsynthesis/src/sysync/stdlogicds.h:162
#12 0x0000000000710657 in sysync::TLocalEngineDS::engSaveSuspendState
(this=0x15bc1c0, aAnyway=false)
Do you have the full HTML log of the session that created this call?
My implementation of that call faithfully checks whether the item
already exists and if so, refuses to update it, as specified in
sync_dbapi.h.
Should be ok - as long as you use the (localID,ident) pair as identity
and not localID alone.
[...]
Should my implementation treat attempts to insert an item which
already
exists as an update? TAdminData::InsertMapItem() seems to do that.
Which would be an explanation why it might have worked for us even in
case the engine really calls Insert instead of Update in some cases.
But still, it's more likely that something else went wrong in the
first place, and then caused this.
Best Regards,
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