Skip to content

Commit

Permalink
Release 2.16.6: Support Elasticsearch 7.14+ (#2238)
Browse files Browse the repository at this point in the history
# 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
  • Loading branch information
alexandrebouthinon authored Dec 21, 2021
1 parent bc14eec commit 1ce8c75
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .ci/test-cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions lib/service/storage/elasticsearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "kuzzle",
"author": "The Kuzzle Team <[email protected]>",
"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"
Expand Down
6 changes: 5 additions & 1 deletion test/service/storage/elasticsearch.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 */ }
}
}
});
Expand Down

0 comments on commit 1ce8c75

Please sign in to comment.