Bug 10159 - koha-rebuild-zebra error handling
Summary: koha-rebuild-zebra error handling
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Packaging (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Tomás Cohen Arazi
QA Contact:
URL:
Keywords:
Depends on:
Blocks: 4876 10259
  Show dependency treegraph
 
Reported: 2013-04-30 14:58 UTC by Tomás Cohen Arazi
Modified: 2014-12-07 20:02 UTC (History)
4 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 10159 - koha-rebuild-zebra error handling (8.33 KB, patch)
2013-04-30 15:16 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 10159 - koha-rebuild-zebra error handling (8.38 KB, patch)
2013-05-12 22:54 UTC, Robin Sheat
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi 2013-04-30 14:58:03 UTC
koha-rebuild-zebra should check stuff like if the instance exists, parameters like -a/-b that should make the DB being reindexed twice and handle errors gracefuly.
Comment 1 Tomás Cohen Arazi 2013-04-30 15:16:32 UTC Comment hidden (obsolete)
Comment 2 Robin Sheat 2013-05-12 22:54:30 UTC
Created attachment 18105 [details] [review]
Bug 10159 - koha-rebuild-zebra error handling

This patch makes koha-rebuild-zebra:
- Check for the existence of the instance
- Handle arbitrary amount of instance parameters
- Capture -a and -b (which made the script rebuild twice the chosen DB). It adds the extended version (--authorities and --biblios respectively) of the option switch. This makes the -a and -b switches work as "only do authorities" (or viceversa). They can be used concurrently, which is the default behaviour when no switch is provided.
- Handle -v (and --verbose) as koha-rebuild-zebra options, to ease the use for non-techie users.
- The rebuild_zebra.pl is wrapped inside an IF to return error values if we ever make rebuild_zebra.pl return error codes (this is pointed in the code).
- Added -h/--help switches and an 'usage' output :-D Please provide patches for any wording issues, or contact me to fix it.

To test:
- Apply the patch and create your packages (or just use the script from your branch)
- Run it in this scenarios / options
  - -h/--help to see the available option switches
  - Mix them with one or more instances, of which some could be fake
  - try -a/--authorities and -b/--biblios in all possible combinations
  - try -v/--verbose works

Regards
To+

Sponsored-by: Universidad Nacional de Córdoba
Signed-off-by: Robin Sheat <robin@catalyst.net.nz>
Comment 3 Jared Camins-Esakov 2013-05-15 13:31:39 UTC
There is one (maybe) problem with this patch, but as it already exists as far as I can tell, I am going to push the patch as-is for 3.12.0: koha-rebuild-zebra does not check if an instance is disabled before reindexing. Arguably it should.
Comment 4 Jared Camins-Esakov 2013-05-15 13:38:23 UTC
This patch has been pushed to master and 3.12.x.
Comment 5 Robin Sheat 2013-05-15 20:12:10 UTC
(In reply to comment #3)
> There is one (maybe) problem with this patch, but as it already exists as
> far as I can tell, I am going to push the patch as-is for 3.12.0:
> koha-rebuild-zebra does not check if an instance is disabled before
> reindexing. Arguably it should.

Specifically it shouldn't. If I'm recovering an instance where the indices have broken, I'll put it into maintenance mode by disabling it while I reindex rather than have people have issues with a half-working system.
Comment 6 Jared Camins-Esakov 2013-05-15 20:32:31 UTC
(In reply to comment #5)
> (In reply to comment #3)
> > There is one (maybe) problem with this patch, but as it already exists as
> > far as I can tell, I am going to push the patch as-is for 3.12.0:
> > koha-rebuild-zebra does not check if an instance is disabled before
> > reindexing. Arguably it should.
> 
> Specifically it shouldn't. If I'm recovering an instance where the indices
> have broken, I'll put it into maintenance mode by disabling it while I
> reindex rather than have people have issues with a half-working system.

Fair enough. However, it might be worth noting that in the help, as all the other Zebra scripts do not do anything when the instance is disabled.
Comment 7 Bernardo Gonzalez Kriegel 2013-06-14 02:22:56 UTC
Pushed to 3.10.x, will be in 3.10.7
Comment 8 Chris Hall 2013-06-17 07:59:07 UTC
Pushed to 3.8.x, will be in 3.8.14