Bug 26448 - koha-elasticsearch --commit parameter is not used
Summary: koha-elasticsearch --commit parameter is not used
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: master
Hardware: All All
: P5 - low trivial (vote)
Assignee: Joonas Kylmälä
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-14 07:24 UTC by Joonas Kylmälä
Modified: 2021-06-14 21:31 UTC (History)
4 users (show)

See Also:
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 (1.17 KB, patch)
2020-09-14 07:33 UTC, Joonas Kylmälä
Details | Diff | Splinter Review
Bug 26448: Don't overwrite commit parameter passed to koha-elasticsearch (1.22 KB, patch)
2020-09-14 10:17 UTC, Nick Clemens
Details | Diff | Splinter Review

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