Bug 9049

Summary: rebuild_zebra should not use shadow when called with -r
Product: Koha Reporter: Jared Camins-Esakov <jcamins>
Component: SearchingAssignee: Galen Charlton <gmcharlt>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P5 - low CC: chris, elliott, jcamins, jonathan.druart, katrin.fischer, matted-34813, mtj
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 9049: Don't use shadow with rebuild_zebra -r
0001-SIGNED-OFF-Bug-9049-Don-t-use-shadow-with-rebuild_zebra
[Signed-Off] [Passed-QA] Bug 9049: Don't use shadow with rebuild_zebra -r

Description Jared Camins-Esakov 2012-11-10 02:57:31 UTC
So far as I can tell, even if shadow indexing fails, rebuild_zebra.pl merrily clears the register, resulting in an empty database despite the precaution of using the shadow index. This seems like a rather large problem to me.
Comment 1 Jared Camins-Esakov 2012-11-10 03:32:29 UTC
It turns out this is actually a limitation of Zebra. In light of this, we should not be using shadow when -r is specified
Comment 2 Jared Camins-Esakov 2012-11-10 13:23:48 UTC Comment hidden (obsolete)
Comment 3 Mason James 2012-11-13 04:21:01 UTC
(In reply to comment #2)
> Created attachment 13372 [details] [review]
> Bug 9049: Don't use shadow with rebuild_zebra -r
> 
> Due to a limitation of Zebra, the register must be cleared *before*
> doing shadow indexing if you want to reset the indexes. In light of
> that, it does not make sense to do shadow indexing at all when
> rebuild_zebra.pl is run with the -r switch. This patch makes -r (reset)
> imply -n (no shadow).
> 
> To test:
> 1) Run `rebuild_zebra.pl -b -r -v -v -v`
> 2) Note that the script never runs the merge phase

how do i determine whether step 2/ does, or does not happen?
Comment 4 Jared Camins-Esakov 2012-11-13 13:43:07 UTC
(In reply to comment #3)
> how do i determine whether step 2/ does, or does not happen?

When the merge is run there are messages like "Merge 0.6% complete (25 minutes remaining)... merge 1.2% complete (24 minutes remaining)... merge 1.8% complete (23 minutes remaining" etc.
Comment 5 wajasu 2012-11-22 15:06:30 UTC Comment hidden (obsolete)
Comment 6 Katrin Fischer 2012-12-01 22:42:24 UTC
I tried reproducing the described behaviour, but following the test plan, I had no 'merge' line in the rebuild_zebra.pl output. Maybe I don't have enough test data. Could someone else please take a look at this?
Comment 7 Jonathan Druart 2012-12-03 09:59:23 UTC
(In reply to comment #6)
> I tried reproducing the described behaviour, but following the test plan, I
> had no 'merge' line in the rebuild_zebra.pl output. Maybe I don't have
> enough test data. Could someone else please take a look at this?

Same behaviour here

$ ./rebuild_zebra.pl -b -r -v -v -v 2>&1 | grep -i merge 
$
Comment 8 Elliott Davis 2012-12-07 16:43:09 UTC
Created attachment 13939 [details] [review]
[Signed-Off] [Passed-QA] Bug 9049: Don't use shadow with rebuild_zebra -r

Due to a limitation of Zebra, the register must be cleared *before*
doing shadow indexing if you want to reset the indexes. In light of
that, it does not make sense to do shadow indexing at all when
rebuild_zebra.pl is run with the -r switch. This patch makes -r (reset)
imply -n (no shadow).

To test:
1) Run `rebuild_zebra.pl -b -r -v -v -v`
2) Note that the script never runs the merge phase

Without the patch I see log lines refering to the shadow cache (enabling shadow spec=/home/koha/koha-dev/var/lib/zebradb/biblios/shadow:20G)
With the patch I don't see anything in the logs about shadow.  I do however see lines about merging.  I think it could just be a misunderstanding of the logs

Signed-off-by: wajasu <matted-34813@mypacks.net>
Signed-off-by: Elliott Davis <elliott@bywatersolutions.com>
Comment 9 Jared Camins-Esakov 2012-12-08 14:46:57 UTC
This patch has been pushed to master.
Comment 10 Chris Cormack 2013-04-24 07:27:58 UTC
Pushed to 3.10.x will be in 3.10.6