Bug 26448

Summary: koha-elasticsearch --commit parameter is not used
Product: Koha Reporter: Joonas Kylmälä <joonas.kylmala>
Component: Command-line UtilitiesAssignee: Joonas Kylmälä <joonas.kylmala>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: trivial    
Priority: P5 - low CC: jonathan.druart, lucas, nick, robin
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21872
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.11.00, 20.05.05
Attachments: Bug 26448: Don't overwrite commit parameter passed to koha-elasticsearch
Bug 26448: Don't overwrite commit parameter passed to koha-elasticsearch

Description Joonas Kylmälä 2020-09-14 07:24:01 UTC
The script debian/scripts/koha-elasticsearch doesn't use the --commit parameter even though it should be used. The issues seem to have appeared after Bug 21872. The rebuild_opts variable should keep its previous value like is done elsewhere in the script with rebuild_opts="${rebuild_opts} but here for the processes parameter it is done like this:

> rebuild_opts="--processes ${processes}"

This overwrites the previous value of rebuild_opts where the --commit parameter was.
Comment 1 Joonas Kylmälä 2020-09-14 07:33:11 UTC
Created attachment 110032 [details] [review]
Bug 26448: Don't overwrite commit parameter passed to koha-elasticsearch

The "--commit" or "-c" parameter was incorrectly not used if it was
passed to the koha-elasticsearch program.

To test:
1) Before patch notice koha-elasticsearch --rebuild --commit 1 -v <instance>
   only commits every 5000 records
2) Apply patch and notice the above command commits every 1 record
Comment 2 Nick Clemens 2020-09-14 10:17:38 UTC
Created attachment 110037 [details] [review]
Bug 26448: Don't overwrite commit parameter passed to koha-elasticsearch

The "--commit" or "-c" parameter was incorrectly not used if it was
passed to the koha-elasticsearch program.

To test:
1) Before patch notice koha-elasticsearch --rebuild --commit 1 -v <instance>
   only commits every 5000 records
2) Apply patch and notice the above command commits every 1 record

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 3 Nick Clemens 2020-09-14 10:18:25 UTC
Nice catch, obvious fix, moving to PQA
Comment 4 Jonathan Druart 2020-09-18 09:54:33 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 5 Lucas Gass 2020-10-16 15:33:37 UTC
backported to 20.05.x for 20.05.05