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

[Fleet] Use optimistic locking when updating installed_es on input package policy creation #148883

Merged
merged 5 commits into from
Jan 24, 2023

Conversation

hop-dev
Copy link
Contributor

@hop-dev hop-dev commented Jan 13, 2023

Summary

Part of #145529

When creating an input package policy, we now create index templates and ingest pipelines. As part of this operation we have to update installed_es on the installation saved object, there is a risk of lost updates if multiple package policies are created at the same time, to combat this i have used the in built saved object optimistic concurrency.

I have tested this locally, we do start see conflicts occur if I create 500 package policies in concurrent batches of 25, but I think we should have a dedicated bulk endpoint if we want to handle more than that.

I haven't pushed the automated tests as they take a few minutes to run and I don't think there is a big enough benefit to running them as part of CI every time.

@hop-dev hop-dev added the Team:Fleet Team label for Observability Data Collection Fleet team label Jan 13, 2023
@hop-dev hop-dev self-assigned this Jan 13, 2023
@hop-dev hop-dev added the release_note:skip Skip the PR/issue when compiling release notes label Jan 13, 2023
@hop-dev hop-dev force-pushed the 145529-input-pkg-asset-race branch from 3a55996 to 3ffceda Compare January 19, 2023 10:03
@hop-dev hop-dev marked this pull request as ready for review January 19, 2023 10:16
@hop-dev hop-dev requested a review from a team as a code owner January 19, 2023 10:16
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

Copy link
Member

@nchaulet nchaulet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe worth adding a unit test, to prevent removing that feature by mistake? Otherwise LGTM 🚀

@hop-dev
Copy link
Contributor Author

hop-dev commented Jan 24, 2023

@elasticmachine merge upstream

@hop-dev hop-dev enabled auto-merge (squash) January 24, 2023 12:01
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

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

cc @hop-dev

@hop-dev hop-dev merged commit f7a1ce9 into elastic:main Jan 24, 2023
@kibanamachine kibanamachine added v8.7.0 backport:skip This commit does not require backporting labels Jan 24, 2023
jloleysens added a commit to jloleysens/kibana that referenced this pull request Jan 24, 2023
* main: (54 commits)
  [APM] Allow calling `createInternalESClient` without `context` (elastic#149320)
  [Synthetics] Errors list active state (elastic#149387)
  [FTRs] Execution Context: fix no data flakiness (elastic#149406)
  [Cloud Posture] - Deprecate csp rule remove migration object (elastic#148530)
  Bump elasticsearch-js to 8.6.0-canary.3 (elastic#148521)
  [Fleet] Use optimistic locking when updating `installed_es` on input package policy creation (elastic#148883)
  [ML] Remove job_type from job definitions in modules (elastic#149247)
  [ML] Consolidate `query_utils` into package `@kbn/ml-query-utils` (elastic#149224)
  [Synthetics] Better formatting for waterfall timeline tooltips (elastic#149142)
  [Cloud Posture] CIS AWS support - changes to findings tables (elastic#148945)
  [Lens] Enable previous time shift when using a date histogram (elastic#149126)
  [Synthetics] Object types panel and thresholds (elastic#149099)
  [Fleet] added back batch exec for update tags (elastic#148618)
  148790 - Fix scroll style for setup guide flyout (elastic#149242)
  Fix a11y issue with dev tool tabs (elastic#149349)
  [APM] Fix mobile indices (elastic#149230)
  [Dashboard] Fix Phrase_filter query for scripted fields (elastic#148942) (elastic#148943)
  renderCustomActionsRow with named params instead of args (elastic#149304)
  [ML] Adding ML execution context to es requests (elastic#148746)
  [Custom Branding] Replace EuiLoadingElastic with EuiLoadingSpinner (elastic#149261)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v8.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants