[upgrade assistant] Stop rollup jobs before reindexing#212815
[upgrade assistant] Stop rollup jobs before reindexing#212815mattkime merged 23 commits intoelastic:8.xfrom
Conversation
x-pack/platform/plugins/private/upgrade_assistant/server/lib/reindexing/reindex_service.ts
Outdated
Show resolved
Hide resolved
…e/kibana into upgrade_assistant_rollup_support
x-pack/platform/plugins/private/upgrade_assistant/server/lib/reindexing/reindex_service.ts
Show resolved
Hide resolved
sabarasaba
left a comment
There was a problem hiding this comment.
tested with the shared data folder and it seems to be working correctly
left few nits, let me know what you think
| let rollupJob; | ||
| if (rollupIndices.length > 0) { | ||
| // there should only be one job | ||
| rollupJob = rollupCaps[rollupIndices[0]].rollup_jobs[0].job_id; |
There was a problem hiding this comment.
nit: this seems a bit brittle, any chance we can make it more resilient?
x-pack/platform/plugins/private/upgrade_assistant/server/lib/update_index/index.ts
Outdated
Show resolved
Hide resolved
|
/ci |
…e/kibana into upgrade_assistant_rollup_support
|
/ci |
|
/ci |
|
/ci |
|
Pinging @elastic/kibana-management (Team:Kibana Management) |
sabarasaba
left a comment
There was a problem hiding this comment.
left few comments, let me know what you think
x-pack/platform/plugins/private/upgrade_assistant/server/lib/rollup_job.ts
Show resolved
Hide resolved
x-pack/platform/plugins/private/upgrade_assistant/server/lib/rollup_job.ts
Show resolved
Hide resolved
x-pack/platform/plugins/private/upgrade_assistant/server/lib/rollup_job.ts
Outdated
Show resolved
Hide resolved
x-pack/platform/plugins/private/upgrade_assistant/server/lib/rollup_job.ts
Outdated
Show resolved
Hide resolved
…ollup_job.ts Co-authored-by: Ignacio Rivas <rivasign@gmail.com>
…e/kibana into upgrade_assistant_rollup_support
jloleysens
left a comment
There was a problem hiding this comment.
Left a few qs, not blockers but I think it would be nice to add an E2E test. Maybe in x-pack/test/upgrade_assistant_integration/upgrade_assistant/reindexing.ts.
x-pack/platform/plugins/private/upgrade_assistant/server/lib/reindexing/reindex_service.ts
Show resolved
Hide resolved
| // stop related rollup job if it exists | ||
| const rollupJob = await getRollupJobByIndexName(esClient, index); | ||
| if (rollupJob) { | ||
| await esClient.rollup.stopJob({ id: rollupJob }); |
There was a problem hiding this comment.
Should we also wait_for_completion: true here? Or might it take too long?
| const { indexName, rollupJob } = reindexOp.attributes; | ||
|
|
||
| if (rollupJob) { | ||
| await esClient.rollup.stopJob({ id: rollupJob, wait_for_completion: true }); |
There was a problem hiding this comment.
What happens when it fails to stop the job? Do we provide users with actionable information about the issue like a manual workaround?
There was a problem hiding this comment.
I think this gets into the expectations surrounding this code. If any other aspect of reindexing fails, do we tell the users about a manual work around?
There's not much reason to expect this to fail. Actually, I'm not sure I'd have much advice for the user if this failed since I'm unfamiliar with what could cause it to fail.
There was a problem hiding this comment.
Yeah generally we return the error message. My question was more about what the content of a failure message is and is it something users can self-service? Generally UA reindexing error messages are self-servicable but I'm not familiar with common failure conditions here so I thought I'd ask.
It might be the case that these are, for example, retryable or something we can handle.
There was a problem hiding this comment.
I checked with @martijnvg and he stated that there's no reason to anticipate any error states when stopping rollups so I think I'll leave the code as is.
💚 Build Succeeded
Metrics [docs]
History
cc @mattkime |
…to 9.1 (#218049) ## Summary forward port of #212815 --- This PR improve support for rollup indices. Rollup indices can be handled like normal indices but jobs should be stopped before reindexing begins or index is marked read only. Also handles case where the rollup job is already stopped. To review: Mark the following read only and make sure rollup jobs are handled as appropriate: Rollup index with and without job running, normal index. Follow up to #212592 and #214656 Closes: #211850
…to 9.1 (elastic#218049) ## Summary forward port of elastic#212815 --- This PR improve support for rollup indices. Rollup indices can be handled like normal indices but jobs should be stopped before reindexing begins or index is marked read only. Also handles case where the rollup job is already stopped. To review: Mark the following read only and make sure rollup jobs are handled as appropriate: Rollup index with and without job running, normal index. Follow up to elastic#212592 and elastic#214656 Closes: elastic#211850
…to 9.1 (elastic#218049) ## Summary forward port of elastic#212815 --- This PR improve support for rollup indices. Rollup indices can be handled like normal indices but jobs should be stopped before reindexing begins or index is marked read only. Also handles case where the rollup job is already stopped. To review: Mark the following read only and make sure rollup jobs are handled as appropriate: Rollup index with and without job running, normal index. Follow up to elastic#212592 and elastic#214656 Closes: elastic#211850
This PR improve support for rollup indices. Rollup indices can be handled like normal indices but jobs should be stopped before reindexing begins or index is marked read only. Also handles case where the rollup job is already stopped.
To review: Mark the following read only and make sure rollup jobs are handled as appropriate: Rollup index with and without job running, normal index.
Follow up to #212592 and #214656
Closes: #211850