From 1ce8c75c5350dfc26d92f513f28d5c075ad6992b Mon Sep 17 00:00:00 2001 From: Alexandre Bouthinon Date: Tue, 21 Dec 2021 09:46:58 +0100 Subject: [PATCH] Release 2.16.6: Support Elasticsearch 7.14+ (#2238) # Why this need some changes by our side? There is a new feature introduced in 7.14 version of Elasticsearch and enabled by default. This one create an index called `.geoip_databases` incompatible with the custom Kuzzle data model. It can be disabled in the `elasticsearch.yml`: ```yaml ingest: geoip: downloader: enabled: false ``` But since this is enable by default, we need to ignore the automatically created index to avoid issues when using the native index:stats Elasticsearch API action --- .ci/test-cluster.yml | 2 +- lib/service/storage/elasticsearch.js | 6 ++++++ package-lock.json | 2 +- package.json | 2 +- test/service/storage/elasticsearch.test.js | 6 +++++- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.ci/test-cluster.yml b/.ci/test-cluster.yml index b0b8b9bbf8..c204b6877e 100644 --- a/.ci/test-cluster.yml +++ b/.ci/test-cluster.yml @@ -78,7 +78,7 @@ services: container_name: kuzzle_redis elasticsearch: - image: kuzzleio/elasticsearch:7 + image: kuzzleio/elasticsearch:7.16.2 container_name: kuzzle_elasticsearch ulimits: nofile: 65536 diff --git a/lib/service/storage/elasticsearch.js b/lib/service/storage/elasticsearch.js index eee9efae92..ce3ef9dfbc 100644 --- a/lib/service/storage/elasticsearch.js +++ b/lib/service/storage/elasticsearch.js @@ -237,6 +237,12 @@ class ElasticSearch extends Service { let size = 0; for (const [indice, indiceInfo] of Object.entries(body.indices)) { + // Ignore non-Kuzzle indices + if ( indice[INDEX_PREFIX_POSITION_IN_INDICE] !== PRIVATE_PREFIX + && indice[INDEX_PREFIX_POSITION_IN_INDICE] !== PUBLIC_PREFIX ) { + continue; + } + const alias = await this._getAliasFromIndice(indice); const indexName = this._extractIndex(alias); const collectionName = this._extractCollection(alias); diff --git a/package-lock.json b/package-lock.json index 209a4e291e..ef208608f7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "kuzzle", - "version": "2.16.5", + "version": "2.16.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 1c678fc770..e2c5e6df82 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "kuzzle", "author": "The Kuzzle Team ", - "version": "2.16.5", + "version": "2.16.6", "description": "Kuzzle is an open-source solution that handles all the data management through a secured API, with a large choice of protocols.", "bin": { "kuzzle": "bin/start-kuzzle-server" diff --git a/test/service/storage/elasticsearch.test.js b/test/service/storage/elasticsearch.test.js index 23d6bca030..936a02ffc8 100644 --- a/test/service/storage/elasticsearch.test.js +++ b/test/service/storage/elasticsearch.test.js @@ -111,7 +111,11 @@ describe('Test: ElasticSearch service', () => { }, '&test-index.test-collection': { total: { docs: { count: 2 }, store: { size_in_bytes: 20 } } - } + }, + '.kibana': { + total: { docs: { count: 2 }, store: { size_in_bytes: 42 } } + }, + '.geoip_databases': { /* This index nativement do not return anything on index:stats call */ } } } });