Bug 22705 - Change default value of Elasticsearch cxn_pool to 'Static'
Summary: Change default value of Elasticsearch cxn_pool to 'Static'
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching - Elasticsearch (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Target Milestone: ---
Assignee: Bugs List
QA Contact:
URL:
Whiteboard:
Keywords: rel_19_05_candidate
Depends on: 21974
Blocks:
  Show dependency treegraph
 
Reported: 2019-04-15 09:13 UTC by Julian Maurice
Modified: 2019-06-18 18:45 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
19.05.00, 18.11.06


Attachments
Bug 22705: Change default value of cxn_pool to 'Static' (1.58 KB, patch)
2019-05-15 06:45 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 22705: Change default value of cxn_pool to 'Static' (1.85 KB, patch)
2019-05-17 12:48 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 22705: Change default value of cxn_pool to 'Static' (1.91 KB, patch)
2019-05-23 13:59 UTC, Chris Cormack
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Julian Maurice 2019-04-15 09:13:06 UTC
Relevant configuration block in $KOHA_CONF:

<elasticsearch>
  <server>elasticsearch5</server>
  <index_name>koha_master</index_name>
</elasticsearch>

% misc/search_tools/rebuild_elastic_search.pl -v
Indexing biblios
[Cxn] ** [http://127.0.0.1:9200]-[599] Could not connect to '127.0.0.1:9200': Connection refused, called from sub Search::Elasticsearch::Role::Client::Direct::__ANON__ at /home/koha/env/master/src/Koha/SearchEngine/Elasticsearch/Indexer.pm line 382. With vars: {'status_code' => 599,'request' => {'serialize' => 'std','method' => 'HEAD','qs' => {},'path' => '/koha_master_biblios','ignore' => [],'body' => undef}}

It looks like it is related to the 'Sniff' CxnPool. When I remove this line https://gitlab.com/koha-community/Koha/blob/7e218b81e6f7e4cf8bb8be3aef547cd1c1aac573/Koha/SearchEngine/Elasticsearch.pm#L146 everything works as expected
Comment 1 Julian Maurice 2019-04-15 10:16:57 UTC
Okay, so I re-read https://wiki.koha-community.org/wiki/Elasticsearch and it's clear that the problem comes from the Sniff CxnPool, I changed $KOHA_CONF to use the Static CxnPool, and it works.

Shouldn't we use Static as the default CxnPool ?
Comment 2 Katrin Fischer 2019-04-18 08:24:00 UTC
Could this be related to Bug 21974? Just going by keywords :)
Comment 3 Julian Maurice 2019-04-18 08:37:43 UTC
(In reply to Katrin Fischer from comment #2)
> Could this be related to Bug 21974? Just going by keywords :)

That is totally related. I'm just complaining about the default value of cxn_pool :)

Sniff (Koha's default) works only with a local ES, while Static (Search::Elasticsearch's default) works in most cases.
Comment 4 Julian Maurice 2019-05-15 06:45:15 UTC
Created attachment 89781 [details] [review]
Bug 22705: Change default value of cxn_pool to 'Static'

'Static' is the default value of Search::Elasticsearch and for a good
reason : it works in most cases, unlike the 'Sniff' option
Comment 5 Nick Clemens 2019-05-17 12:48:11 UTC
Created attachment 89897 [details] [review]
Bug 22705: Change default value of cxn_pool to 'Static'

'Static' is the default value of Search::Elasticsearch and for a good
reason : it works in most cases, unlike the 'Sniff' option

To test:
1 - Apply patch
2 - Edit koha-conf.xml
3 - Add '<cxn_pool>Static</cxn_pool>' to the elasticsearch stanza
4 - Restart all the things!
5 - Reindex ES, it works
6 - Set SearchEngine to ES, try searching
7 - It works!

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 6 Chris Cormack 2019-05-23 13:59:57 UTC
Created attachment 90033 [details] [review]
Bug 22705: Change default value of cxn_pool to 'Static'

'Static' is the default value of Search::Elasticsearch and for a good
reason : it works in most cases, unlike the 'Sniff' option

To test:
1 - Apply patch
2 - Edit koha-conf.xml
3 - Add '<cxn_pool>Static</cxn_pool>' to the elasticsearch stanza
4 - Restart all the things!
5 - Reindex ES, it works
6 - Set SearchEngine to ES, try searching
7 - It works!

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Comment 7 Nick Clemens 2019-05-23 15:02:23 UTC
Awesome work all!

Pushed to master for 19.05
Comment 8 Martin Renvoize 2019-05-30 19:42:21 UTC
Pushed to 18.11.x for 18.11.06
Comment 9 Liz Rea 2019-06-18 18:45:00 UTC
I'm declining this for the 18.05 track, as there aren't probably many users using ES, and I want people to have a reason to upgrade.

You can feel free to try and convince me to do something different. :)

Cheers,
Liz