SONAR-12686 upgrade es client to 7.9.3 and move to HTTP
- add should minimum match eq 1 to user index queries
ES 7.X changed behaviour in case filter query with bool it defaults to '0'
https://www.elastic.co/guide/en/elasticsearch/reference/7.x/breaking-changes-7.0.html#_the_filter_context_has_been_removed
- fix issue index routing param
ES 7.X helped discover this bug as new setting has been auto configured which is 'index.number_of_routing_shards'.
This has changed how documents are distributed across shards depending on how many shards the index has.
Without that change issues docs has been incorrectly routed to the same shard hash as projects and it worked no matter what routing key you used projectUuid or auth_projectUuid.
- update ngram and edge_ngram names to match with es 7.x
nGram and edgeNgram has been deprecated in favour of ngram and edge_ngram
https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking-changes-7.0.html#deprecated-ngram-edgengram-token-filter-cannot-be-used
- remove `_all : enabled` usage from UT
This field was already deprecated in 6.X, now it has been removed.
https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking-changes-7.0.html#all-meta-field-removed
- add Elasticsearch High Level REST client dependency
- use sonar.search.port for ES HTTP
- main process use ES Rest client to check ES status
- sonar.cluster.search.hosts has HTTP ports on APP nodes
also sonar.search.port and sonar.search.host MUST be configured on each Search node with the host and HTTP port of the current node
- use Elasticsearch high level rest client
- use in EsTester
- use as primary es client
- use indices api to get all indices name instead of cluster api
- use cluster health api to check cluster state
- support raw requests for 'nodes/_stats' and '_cluster/stats'
- support raw requests for 'indices/_stats'
- leave netty4plugin as testCompile dependency it is used in UTs
- all ES non-test calls go through EsClient class
- add rest client ES profiling
SONAR-12686 fix ES discovery settings in cluster mode
deprecated "discovery.zen.ping.unicast.hosts" has been removed, "discovery.seed_hosts" should be used instead
"discovery.zen.minimum_master_nodes" is ignored now: stop setting it and drop sonar property "sonar.search.minimumMasterNodes"
SONAR-12686 update JVM options to match defaults in ES 7.X
Elastic introduced "system" JVM settings in 7.X:
* "system" settings are set from Java code (class SystemJvmOptions)
* which means these JVM settings are not defined in "jvm.options" file anymore
protect ManagedProcessHandler stop finalization code with lifecycle state
since this code is interrupting other threads, this ensures concurrent threads attempting to run this code will never interrupt each other
leading to unpredictable and unreproducible behavior
do not call stop finalization code without checking lifeCycle state
this avoid having multiple thread call the stope finalization concurrently and killing each other, which is unpredictable and very hard to reproduce behavior
add node state FINALIZE_STOPPING to sync stop finalizing code
this prevents concurrent threads to shutdown each other
this removes a test on NodeLifecycle.getState() which could be unthreadsafe and keep all lifeCycle logic in NodeLifecycle class
stop should be allowed when SQ is not yet fully operational
this allows to keep stop code behing lifecycle transition test
which prevents multiple stop sequence to be initiated in parallel from different thread
which may interrupt each other and create unstable behaviors (with cryptic non reproducible errors)