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

[UA] Make reindex error handling more robust #33060

Merged
merged 1 commit into from Mar 13, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -359,12 +359,9 @@ export const reindexServiceFactory = (
const { count } = await callCluster('count', { index: reindexOp.attributes.indexName });

if (taskResponse.task.status.created < count) {
if (taskResponse.response.failures && taskResponse.response.failures.length > 0) {
const failureExample = JSON.stringify(taskResponse.response.failures[0]);
throw Boom.badData(`Reindexing failed with failures like: ${failureExample}`);
} else {
throw Boom.badData('Reindexing failed due to new documents created in original index.');
}
// 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 Boom.badData(`Reindexing failed: ${JSON.stringify(taskResponse)}`);
}

// Update the status
Expand Down