[Koha-bugs] [Bug 11078] rebuild_zebra.pl can lose updates due to race condition during full rebuilds

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Oct 22 00:17:05 CEST 2013


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11078

--- Comment #3 from Martin Renvoize <martin.renvoize at ptfs-europe.com> ---
Created attachment 22205
  -->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=22205&action=edit
Bug 6345 Add locking to rebuild_zebra

This patch adds flock based locking for rebuild_zebra.pl on a per-instance
basis.
This prevents races between full rebuilds and background incremental updates
from
the zebraqueue table in the database.

The race condition exists whether you are doing incremental updates with
a periodic cronjob or with the new daemon mode.  Suppose you start a full
rebuild
at time T0 which will take until T20 to extract the records.  Suppose also at
T10,
a biblio or auth is updated and processed through the zebraqueue by T15.
In this situation the updated record in zebra will be overwritten when
the full rebuild records are uploaded to zebra after T20.  We prevent this
by only allowing one rebuild_zebra per koha instance to be running at one time.

When running in daemon mode, incremental updates will be skipped while
a full rebuild is running, and resume afterwards.  A full rebuild or other
adhoc request will wait for any previous lock to clear.

Tested by flocking the lock file while invoking rebuild_zebra.pl in
various modes (daemon, adhoc zebraqueue task, and full rebuild) using
flock program I will attach to bug.

http://bugs.koha-community.org/show_bug.cgi?id=11078
Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

http://bugs.koha-community.org/show_bug.cgi?id=6435

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list