Skip to content

Commit

Permalink
[Upgrade Assistant] Update logic for handling reindex failures (#125246
Browse files Browse the repository at this point in the history
)
  • Loading branch information
alisonelizabeth authored Feb 11, 2022
1 parent 3c47a05 commit 9cba32e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ export const ChecklistFlyoutStep: React.FunctionComponent<{
)}
{(hasFetchFailed || hasReindexingFailed) && (
<>
<EuiSpacer />
<EuiCallOut
color="danger"
iconType="alert"
Expand All @@ -130,6 +129,7 @@ export const ChecklistFlyoutStep: React.FunctionComponent<{
>
{reindexState.errorMessage}
</EuiCallOut>
<EuiSpacer />
</>
)}
<EuiText>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)}`);
Expand Down

0 comments on commit 9cba32e

Please sign in to comment.