Bug 9050: Use safer adelete when deleting records from Zebra index
authorJared Camins-Esakov <jcamins@cpbibliography.com>
Sat, 10 Nov 2012 13:40:19 +0000 (08:40 -0500)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Mon, 12 Nov 2012 23:53:49 +0000 (18:53 -0500)
commitdeeeb068d9c92b2f46689230398d8ad2611a5517
treef123d81bc939e8e5d29dc6ce027b12e3709d7b39
parentbc9c8c4124e6fe61ce0b3afe3b2d37c00fc7268a
Bug 9050: Use safer adelete when deleting records from Zebra index

Previously we used the "delete" command in zebraidx, which fails when
you try to delete a record that doesn't exist in the index. By changing
to the "adelete" command, we can reduce the likelihood of a failed
delete causing ghost records. A symptom of this problem is the warning
message occasionally encountered when indexing from the zebraqueue,
"[warn] cannot delete record above (seems new)."

To test:
1) Add a recordDelete action for a record that does not exist to
   zebraqueue in MySQL:
   INSERT INTO zebraqueue (biblio_auth_number, operation, server) \
       VALUES (999999999, 'recordDelete', 'biblioserver');
2) Run `rebuild_zebra.pl -b -z -v [-x]`.
3) Note that you do not get the message "[warn] cannot delete record
   above (seems new)".

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Passed-QA-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
misc/migration_tools/rebuild_zebra.pl