From bf624248ba338ee7e143429874536c35de85c42a Mon Sep 17 00:00:00 2001 From: Jean-Louis Leysens Date: Thu, 12 Mar 2020 09:56:51 +0100 Subject: [PATCH] Added comment --- .../upgrade_assistant/server/lib/reindexing/reindex_service.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.ts b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.ts index a6a1152317a0a..b270998658db8 100644 --- a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.ts +++ b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.ts @@ -321,6 +321,8 @@ export const reindexServiceFactory = ( const startReindexing = async (reindexOp: ReindexSavedObject) => { const { indexName, reindexOptions } = reindexOp.attributes; + // Where possible, derive reindex options at the last moment before reindexing + // to prevent them from becoming stale as they wait in the queue. const indicesState = await esIndicesStateCheck(callAsUser, [indexName]); const openAndClose = indicesState[indexName] === 'close'; if (indicesState[indexName] === 'close') {