[Upgrade Assistant] Update logic for handling reindex failures (#125246)

This commit is contained in:
Alison Goryachev 2022-02-11 08:00:10 -05:00 committed by GitHub
parent 3c47a05f7a
commit 9cba32e630
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 7 deletions

View file

@ -109,7 +109,6 @@ export const ChecklistFlyoutStep: React.FunctionComponent<{
)}
{(hasFetchFailed || hasReindexingFailed) && (
<>
<EuiSpacer />
<EuiCallOut
color="danger"
iconType="alert"
@ -130,6 +129,7 @@ export const ChecklistFlyoutStep: React.FunctionComponent<{
>
{reindexState.errorMessage}
</EuiCallOut>
<EuiSpacer />
</>
)}
<EuiText>

View file

@ -293,12 +293,8 @@ export const reindexServiceFactory = (
// Do any other cleanup work necessary
reindexOp = await cleanupChanges(reindexOp);
} else {
// Check that it reindexed all documents
const {
body: { count },
} = await esClient.count({ index: reindexOp.attributes.indexName });
if (taskResponse.task.status!.created < count) {
// Check that no failures occurred
if (taskResponse.response?.failures?.length) {
// Include the entire task result in the error message. This should be guaranteed
// to be JSON-serializable since it just came back from Elasticsearch.
throw error.reindexTaskFailed(`Reindexing failed: ${JSON.stringify(taskResponse)}`);