From 0803fc4e56a60f131f5e7345e12aa3106eb9ae50 Mon Sep 17 00:00:00 2001 From: Jared Noble Date: Mon, 10 Jul 2023 09:03:39 -0700 Subject: [PATCH 1/3] fix bug around index creation and teraslice startup --- packages/elasticsearch-api/index.js | 7 ++++++- .../method-helpers/indicesPutTemplate.ts | 9 ++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/elasticsearch-api/index.js b/packages/elasticsearch-api/index.js index 7a4b944563e..4f1fd04ff1f 100644 --- a/packages/elasticsearch-api/index.js +++ b/packages/elasticsearch-api/index.js @@ -971,6 +971,11 @@ module.exports = function elasticsearchApi(client, logger, _opConfig) { return distribution === ElasticsearchDistribution.elasticsearch && majorVersion === 8; } + function isOpensearch2() { + const { distribution, majorVersion } = getClientMetadata(); + return distribution === ElasticsearchDistribution.opensearch && majorVersion === 2; + } + function _fixMappingRequest(_params, isTemplate) { if (!_params || !_params.body) { throw new Error('Invalid mapping request'); @@ -1000,7 +1005,7 @@ module.exports = function elasticsearchApi(client, logger, _opConfig) { } } - if (isElasticsearch8(client)) { + if (isElasticsearch8(client) || isOpensearch2(client)) { delete defaultParams.includeTypeName; } diff --git a/packages/elasticsearch-store/src/elasticsearch-client/method-helpers/indicesPutTemplate.ts b/packages/elasticsearch-store/src/elasticsearch-client/method-helpers/indicesPutTemplate.ts index ef9a67beaec..d5c45d4244e 100644 --- a/packages/elasticsearch-store/src/elasticsearch-client/method-helpers/indicesPutTemplate.ts +++ b/packages/elasticsearch-store/src/elasticsearch-client/method-helpers/indicesPutTemplate.ts @@ -9,7 +9,7 @@ export function convertIndicesPutTemplateParams( const { majorVersion, distribution, - version + version, } = distributionMeta; if (distribution === ElasticsearchDistribution.elasticsearch) { @@ -57,11 +57,18 @@ export function convertIndicesPutTemplateParams( const { include_type_name, master_timeout, + body, ...parsedParams } = params; + const newBody = { + ...body, + mappings: ensureNoTypeInMapping(body?.mappings), + }; + return { ...parsedParams, + body: newBody, ...(master_timeout !== undefined && { cluster_manager_timeout: master_timeout }), }; } From 7027ce96a2147f538ce18be73a3c1ea3a3a2f838 Mon Sep 17 00:00:00 2001 From: Jared Noble Date: Mon, 10 Jul 2023 09:04:11 -0700 Subject: [PATCH 2/3] bump: (patch) @terascope/elasticsearch-api@3.6.1, @terascope/teraslice-state-storage@0.39.1 bump: (patch) elasticsearch-store@0.67.2, terafoundation@0.45.2 --- e2e/package.json | 2 +- packages/elasticsearch-api/package.json | 4 ++-- packages/elasticsearch-store/package.json | 2 +- packages/terafoundation/package.json | 4 ++-- packages/teraslice-state-storage/package.json | 4 ++-- packages/teraslice/package.json | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/e2e/package.json b/e2e/package.json index 730dbc4465a..5d994dfbf26 100644 --- a/e2e/package.json +++ b/e2e/package.json @@ -33,7 +33,7 @@ }, "devDependencies": { "bunyan": "^1.8.15", - "elasticsearch-store": "^0.67.1", + "elasticsearch-store": "^0.67.2", "fs-extra": "^10.1.0", "ms": "^2.1.3", "nanoid": "^3.3.4", diff --git a/packages/elasticsearch-api/package.json b/packages/elasticsearch-api/package.json index a1e79b3067a..ff690a07521 100644 --- a/packages/elasticsearch-api/package.json +++ b/packages/elasticsearch-api/package.json @@ -1,7 +1,7 @@ { "name": "@terascope/elasticsearch-api", "displayName": "Elasticsearch API", - "version": "3.6.0", + "version": "3.6.1", "description": "Elasticsearch client api used across multiple services, handles retries and exponential backoff", "homepage": "https://github.com/terascope/teraslice/tree/master/packages/elasticsearch-api#readme", "bugs": { @@ -31,7 +31,7 @@ "@opensearch-project/opensearch": "^1.2.0", "@types/elasticsearch": "^5.0.40", "elasticsearch": "^15.4.1", - "elasticsearch-store": "^0.67.1", + "elasticsearch-store": "^0.67.2", "elasticsearch6": "npm:@elastic/elasticsearch@^6.7.0", "elasticsearch7": "npm:@elastic/elasticsearch@^7.0.0", "elasticsearch8": "npm:@elastic/elasticsearch@^8.0.0" diff --git a/packages/elasticsearch-store/package.json b/packages/elasticsearch-store/package.json index 33b4ba79140..b6eeb3827ff 100644 --- a/packages/elasticsearch-store/package.json +++ b/packages/elasticsearch-store/package.json @@ -1,7 +1,7 @@ { "name": "elasticsearch-store", "displayName": "Elasticsearch Store", - "version": "0.67.1", + "version": "0.67.2", "description": "An API for managing an elasticsearch index, with versioning and migration support.", "homepage": "https://github.com/terascope/teraslice/tree/master/packages/elasticsearch-store#readme", "bugs": { diff --git a/packages/terafoundation/package.json b/packages/terafoundation/package.json index ae8318c2710..349d42a21ed 100644 --- a/packages/terafoundation/package.json +++ b/packages/terafoundation/package.json @@ -1,7 +1,7 @@ { "name": "terafoundation", "displayName": "Terafoundation", - "version": "0.45.1", + "version": "0.45.2", "description": "A Clustering and Foundation tool for Terascope Tools", "homepage": "https://github.com/terascope/teraslice/tree/master/packages/terafoundation#readme", "bugs": { @@ -36,7 +36,7 @@ "convict-format-with-moment": "^6.2.0", "convict-format-with-validator": "^6.2.0", "elasticsearch": "^15.4.1", - "elasticsearch-store": "^0.67.1", + "elasticsearch-store": "^0.67.2", "js-yaml": "^4.1.0", "mongoose": "~6.6.5", "nanoid": "^3.3.4", diff --git a/packages/teraslice-state-storage/package.json b/packages/teraslice-state-storage/package.json index 7f8744840eb..a5e44432039 100644 --- a/packages/teraslice-state-storage/package.json +++ b/packages/teraslice-state-storage/package.json @@ -1,7 +1,7 @@ { "name": "@terascope/teraslice-state-storage", "displayName": "Teraslice State Storage", - "version": "0.39.0", + "version": "0.39.1", "description": "State storage operation api for teraslice", "homepage": "https://github.com/terascope/teraslice/tree/master/packages/teraslice-state-storage#readme", "bugs": { @@ -23,7 +23,7 @@ "test:watch": "ts-scripts test --watch . --" }, "dependencies": { - "@terascope/elasticsearch-api": "^3.6.0", + "@terascope/elasticsearch-api": "^3.6.1", "@terascope/utils": "^0.46.0" }, "engines": { diff --git a/packages/teraslice/package.json b/packages/teraslice/package.json index 14ab6d994ab..5397cae8a25 100644 --- a/packages/teraslice/package.json +++ b/packages/teraslice/package.json @@ -37,7 +37,7 @@ "ms": "^2.1.3" }, "dependencies": { - "@terascope/elasticsearch-api": "^3.6.0", + "@terascope/elasticsearch-api": "^3.6.1", "@terascope/job-components": "^0.59.0", "@terascope/teraslice-messaging": "^0.29.0", "@terascope/utils": "^0.46.0", @@ -61,7 +61,7 @@ "semver": "^7.3.8", "socket.io": "^1.7.4", "socket.io-client": "^1.7.4", - "terafoundation": "^0.45.1", + "terafoundation": "^0.45.2", "uuid": "^9.0.0" }, "devDependencies": { From b1b13ee9d810b8915c23a0cf4740d92071308d4f Mon Sep 17 00:00:00 2001 From: Jared Noble Date: Mon, 10 Jul 2023 09:04:26 -0700 Subject: [PATCH 3/3] release: (minor) teraslice@0.86.0 --- package.json | 2 +- packages/teraslice/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 010d82058ee..60c331fceee 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "teraslice-workspace", "displayName": "Teraslice", - "version": "0.85.0", + "version": "0.86.0", "private": true, "homepage": "https://github.com/terascope/teraslice", "bugs": { diff --git a/packages/teraslice/package.json b/packages/teraslice/package.json index 5397cae8a25..f0e93719ecc 100644 --- a/packages/teraslice/package.json +++ b/packages/teraslice/package.json @@ -1,7 +1,7 @@ { "name": "teraslice", "displayName": "Teraslice", - "version": "0.85.0", + "version": "0.86.0", "description": "Distributed computing platform for processing JSON data", "homepage": "https://github.com/terascope/teraslice#readme", "bugs": {