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

[Ingest Manager][EPM] Moving reinstall function outside of promise.all #82672

Conversation

jonathan-buttner
Copy link
Contributor

This is to address this issue: #82614
Related fix for 7.10: #82664 (was merged directly to 7.10)

There is a potential for a race condition during the /setup API call if one of the required packages is in the installing state. A required package can get in this state if a failure occurred to install/upgrade that package and we were unable to rollback the package for some reason.

Upon the next call to /setup, if the package can be upgraded, the upgrade code will be initiated in addition to attempting to reinstall the failed package version because both the

ensureInstalledDefaultPackages and the ensurePackagesCompletedInstall calls happen in parallel in the Promise.all.

This PR tries to mitigate that by moving the reinstall functionality outside of the Promise.all so that it is done after the upgrade attempt.

This PR fixes the issue in master and will be backported to 7.x as well.

@jonathan-buttner jonathan-buttner added v8.0.0 release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v7.11.0 labels Nov 4, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/ingest-management (Team:Ingest Management)

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

distributable file count

id before after diff
default - 42717 +42717

Saved Objects .kibana field count

id before after diff
_data_stream_timestamp - 1 +1
_doc_count - 1 +1
action - 5 +5
action_task_params - 3 +3
alert - 30 +30
apm-indices - 8 +8
application_usage_daily - 2 +2
canvas-element - 8 +8
canvas-workpad - 5 +5
canvas-workpad-template - 8 +8
cases - 38 +38
cases-comments - 18 +18
cases-configure - 19 +19
cases-user-actions - 10 +10
config - 2 +2
dashboard - 17 +17
endpoint:user-artifact - 10 +10
endpoint:user-artifact-manifest - 5 +5
epm-packages - 15 +15
exception-list - 39 +39
exception-list-agnostic - 39 +39
file-upload-telemetry - 2 +2
fleet-agent-actions - 9 +9
fleet-agent-events - 11 +11
fleet-agents - 25 +25
fleet-enrollment-api-keys - 10 +10
graph-workspace - 9 +9
index-pattern - 3 +3
ingest_manager_settings - 6 +6
ingest-agent-policies - 11 +11
ingest-outputs - 11 +11
ingest-package-policies - 35 +35
kql-telemetry - 3 +3
lens - 7 +7
lens-ui-telemetry - 5 +5
map - 7 +7
ml-job - 6 +6
ml-telemetry - 3 +3
monitoring-telemetry - 2 +2
namespace - 1 +1
namespaces - 1 +1
originId - 1 +1
query - 6 +6
references - 4 +4
sample-data-telemetry - 3 +3
search - 9 +9
siem-detection-engine-rule-actions - 8 +8
siem-detection-engine-rule-status - 12 +12
siem-ui-timeline - 90 +90
siem-ui-timeline-note - 8 +8
siem-ui-timeline-pinned-event - 7 +7
space - 9 +9
tag - 4 +4
telemetry - 9 +9
timelion-sheet - 13 +13
tsvb-validation-telemetry - 2 +2
type - 1 +1
ui-metric - 2 +2
updated_at - 1 +1
upgrade-assistant-reindex-operation - 18 +18
upgrade-assistant-telemetry - 13 +13
url - 6 +6
visualization - 9 +9
total +685

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@jonathan-buttner jonathan-buttner merged commit f8f163c into elastic:master Nov 5, 2020
@jonathan-buttner jonathan-buttner deleted the fix-ingest-reinstall-race-master branch November 5, 2020 01:24
jonathan-buttner added a commit to jonathan-buttner/kibana that referenced this pull request Nov 5, 2020
gmmorris added a commit to gmmorris/kibana that referenced this pull request Nov 5, 2020
* master: (127 commits)
  [ILM] Fix breadcrumbs (elastic#82594)
  [UX]Swap env filter with percentile (elastic#82246)
  Add platform's missing READMEs (elastic#82268)
  [Discover] Adding uiMetric to track Visualize link click (elastic#82344)
  [Search] Add used index pattern name to the search agg error field (elastic#82604)
  improve client-side SO client get pooling (elastic#82603)
  [Security Solution] Unskips Overview tests (elastic#82459)
  Embeddables/migrations (elastic#82296)
  [Enterprise Search] Refactor product server route registrations to their own files/folders (elastic#82663)
  Moving reinstall function outside of promise.all (elastic#82672)
  Load choropleth layer correctly (elastic#82628)
  Master  backport elastic#81233 (elastic#82642)
  [Fleet] Allow snake cased Kibana assets (elastic#77515)
  Reduce saved objects authorization checks (elastic#82204)
  [data.search] Add request handler context and asScoped pattern (elastic#80775)
  [ML] Fixes formatting of fields in index data visualizer (elastic#82593)
  Usage collector readme (elastic#82548)
  [Lens] Visualization validation and better error messages (elastic#81439)
  [ML] Add annotation markers to time series brush area to indicate annotations exist outside of selected range (elastic#81490)
  chore(NA): install microdnf in UBI docker build only (elastic#82611)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants