Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Feb 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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