Bug 9049 - rebuild_zebra should not use shadow when called with -r
Summary: rebuild_zebra should not use shadow when called with -r
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Galen Charlton
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-10 02:57 UTC by Jared Camins-Esakov
Modified: 2014-05-26 21:05 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 9049: Don't use shadow with rebuild_zebra -r (1.47 KB, patch)
2012-11-10 13:23 UTC, Jared Camins-Esakov
Details | Diff | Splinter Review
0001-SIGNED-OFF-Bug-9049-Don-t-use-shadow-with-rebuild_zebra (1.54 KB, patch)
2012-11-22 15:06 UTC, wajasu
Details | Diff | Splinter Review
[Signed-Off] [Passed-QA] Bug 9049: Don't use shadow with rebuild_zebra -r (1.90 KB, patch)
2012-12-07 16:43 UTC, Elliott Davis
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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