Ticket #960 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

Trigger slow-sync when hashtable get malformed/deleted

Reported by: dgollub Owned by: dgollub
Priority: high Milestone: OpenSync 0.40
Component: OpenSync: Engine Version: 0.38
Severity: critical Keywords:
Cc:

Description

Deleting of hashtable.db can cause unexpected synchronization results: e.g. duplicates.

Plugins which rely on the hashtable need to get the chance to detect if the hashtable got deleted and a slow-sync is required.

Otherwise a missing/deleted hashtable would end-up in a plugin which reports _every_ entry as new change in a fast-sync -> duplicates.

This scenario got reported by ticket 901 comment 8.

Change History

comment:1 Changed 3 years ago by henrik

This should be up to the individual plugins.

If there is no hashtable (either first sync or it has been removed) the plugin should simply request a slowsync.

Same goes for anchor.db

Not so sure about archive.db; I don't know what it is doing, but looks like some engine stuff that the plugins are not aware of.

comment:2 Changed 2 years ago by dgollub

  • Component changed from OpenSync to OpenSync: Engine

Still present for trunk i guess ...

comment:3 Changed 2 years ago by dgollub

  • Status changed from new to assigned

comment:4 Changed 2 years ago by dgollub

(In [5986]) Marshal/Denmarshal? the slow-sync attribute of a ObjtypeSink?. This is required to trigger a slow-sync in the initailze state. This coudl happen in case the hashtable got deleted.

see #960

comment:5 Changed 2 years ago by dgollub

(In [5987]) Add a parameter in osync_hashtable_new to allow to report that the hashtable got newly created. This helps to identify that the hashtable might got deleted. This is useful to report a slowsync in this case

see #960

comment:6 Changed 2 years ago by dgollub

(In [5988]) Set slow-sync for ObjTypeSink? if the hashtable got deleted.

refs #960

comment:7 Changed 2 years ago by dgollub

(In [5989]) Fix build of test/support.o this got broken with previous commit when introducing a new parameter to osync_hashtable_new

refs #960

comment:8 Changed 2 years ago by dgollub

(In [5990]) remove debugging statement/printf

refs #960

comment:9 Changed 2 years ago by dgollub

(In [5991]) Reset slow-sync set to allow multiple syncs (multi-sync) with one initialized OSyncEngine. Slow-sync reset was always unclean and only got reseted after the next connect() call. Since slow-syncs now can be triggered even before a connect (e.g. hashtable deletion) things needed to get cleaned up. Since sync-done() function is the very last plugin call in a multi-sync the slow-sync state get rested there for OSyncClientProxy and OSyncClient.

refs #960

comment:10 Changed 2 years ago by dgollub

  • Status changed from assigned to closed
  • Resolution set to fixed

(In [5992]) Introduce testcase to verify correct slow-sync once the hashtable gets deleted.

fixes #960

Note: See TracTickets for help on using tickets.