From 5ac122e5b4b933471f52b05e1c596a7cfd26ee56 Mon Sep 17 00:00:00 2001 From: Huy Nguyen <73027756+huyaboo@users.noreply.github.com> Date: Wed, 28 Aug 2024 22:16:53 +0000 Subject: [PATCH 1/2] Fix issue bootstrapping dynamic config service Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com> --- .../opensearch_config_store.test.ts | 21 +++++++++++++++++++ .../opensearch_config_store_client.ts | 10 +++++++++ 2 files changed, 31 insertions(+) diff --git a/src/core/server/config/service/config_store_client/opensearch_config_store.test.ts b/src/core/server/config/service/config_store_client/opensearch_config_store.test.ts index df34a3cc7867..967ed2900bbc 100644 --- a/src/core/server/config/service/config_store_client/opensearch_config_store.test.ts +++ b/src/core/server/config/service/config_store_client/opensearch_config_store.test.ts @@ -71,6 +71,7 @@ describe('OpenSearchConfigStoreClient', () => { hits: mockHits.map((hit) => ({ _index: getDynamicConfigIndexName(1), _id: JSON.stringify(hit), + _version: 1, _source: hit, })), }, @@ -299,6 +300,11 @@ describe('OpenSearchConfigStoreClient', () => { { create: { _id: itemId, + _index: DYNAMIC_APP_CONFIG_ALIAS, + retry_on_conflict: 2, + routing: '', + version: 1, + version_type: 'external', }, }, { @@ -314,6 +320,11 @@ describe('OpenSearchConfigStoreClient', () => { { update: { _id: JSON.stringify(configDocument), + _index: DYNAMIC_APP_CONFIG_ALIAS, + retry_on_conflict: 2, + routing: '', + version: 2, + version_type: 'external', }, }, { @@ -483,6 +494,11 @@ describe('OpenSearchConfigStoreClient', () => { { update: { _id: JSON.stringify(oldConfig), + _index: DYNAMIC_APP_CONFIG_ALIAS, + retry_on_conflict: 2, + routing: '', + version: 2, + version_type: 'external', }, }, { @@ -503,6 +519,11 @@ describe('OpenSearchConfigStoreClient', () => { { create: { _id: JSON.stringify(config), + _index: DYNAMIC_APP_CONFIG_ALIAS, + retry_on_conflict: 2, + routing: '', + version: 1, + version_type: 'external', }, }, { diff --git a/src/core/server/config/service/config_store_client/opensearch_config_store_client.ts b/src/core/server/config/service/config_store_client/opensearch_config_store_client.ts index a4eef916fcf1..8cae9284a937 100644 --- a/src/core/server/config/service/config_store_client/opensearch_config_store_client.ts +++ b/src/core/server/config/service/config_store_client/opensearch_config_store_client.ts @@ -240,6 +240,11 @@ export class OpenSearchConfigStoreClient implements IDynamicConfigStoreClient { { update: { _id: config._id, + _index: DYNAMIC_APP_CONFIG_ALIAS, + retry_on_conflict: 2, + routing: '', + version: config._version! + 1, + version_type: 'external', }, }, { @@ -267,6 +272,11 @@ export class OpenSearchConfigStoreClient implements IDynamicConfigStoreClient { { create: { _id: uniqueId(), + _index: DYNAMIC_APP_CONFIG_ALIAS, + retry_on_conflict: 2, + routing: '', + version: 1, + version_type: 'external', }, }, newConfigDocument From f376df955499bf85b64915dbb67578e8bf8e36bd Mon Sep 17 00:00:00 2001 From: "opensearch-changeset-bot[bot]" <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> Date: Thu, 29 Aug 2024 00:25:26 +0000 Subject: [PATCH 2/2] Changeset file for PR #7901 created/updated --- changelogs/fragments/7901.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 changelogs/fragments/7901.yml diff --git a/changelogs/fragments/7901.yml b/changelogs/fragments/7901.yml new file mode 100644 index 000000000000..9ca9fd670808 --- /dev/null +++ b/changelogs/fragments/7901.yml @@ -0,0 +1,2 @@ +fix: +- Fix bootstrap errors in 2.x ([#7901](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7901)) \ No newline at end of file