[Ingest Manager] Internal action for policy reassign#78493
[Ingest Manager] Internal action for policy reassign#78493nchaulet merged 3 commits intoelastic:masterfrom
Conversation
|
@jen-huang what do you think of this approach? I am considering moving forward with that and adding this for bulk actions if it sounds good to you? |
|
@nchaulet I am in favor of this approach, I spent some time thinking about about alternatives but couldn't think of anything better that wouldn't require major restructuring. I think it would be good to add some code comments here to say that |
|
Pinging @elastic/ingest-management (Team:Ingest Management) |
jen-huang
left a comment
There was a problem hiding this comment.
Tested locally with latest 7.10 snapshot of agent, policy reassignment got picked up super fast and regular policy change worked like normal. Code LGTM 👍
|
One thing I noticed in my testing is that unenrollment still takes a long time to be acknowledged. I wonder if it is possible to use the same kind of |
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: |
Yes the force unenroll will benefits to use the same pattern, I will try to get another PR for that or at least an issue |
…into feature/task_manager_429 * 'feature/task_manager_429' of github.com:elastic/kibana: (158 commits) Add license check to direct package upload handler. (#79653) [Ingest Manager] Rename API /api/ingest_manager => /api/fleet (#79193) [Security Solution][Resolver] Simplify CopyableField styling and add comments (#79594) Fine-tunes ML related text on Metrics UI (#79425) [ML] DF Analytics creation wizard: ensure job creation possible when model memory lower than estimate (#79229) Add new "Add Data" tutorials (#77237) Update APM telemetry docs (#79583) Revert "Add support for runtime field types to mappings editor. (#77420)" (#79611) Kibana request headers (#79218) ensure missing indexPattern error is bubbled up to error callout (#79378) Missing space fix (#79585) remove duplicate tab states (#79501) [data.ui] Lazy load UI components in data plugin. (#78889) Add generic type params to search dependency. (#79608) [Ingest Manager] Internal action for policy reassign (#78493) [ILM] Add index_codec to forcemerge action in hot and warm phases (#78175) [Ingest Manager] Update open API spec and add condition to agent upgrade endpoint (#79579) [ML] Hide Data Grid column options when histogram charts are enabled. (#79459) [Telemetry] Synchronous `setup` and `start` methods (#79457) [Observability] Persist time range across apps (#79258) ...
Summary
Resolves #77613
When we introduced long polling for agent checkin, we introduced a bug for policy reassignment.
Agent policy reassignment is triggered by removing the field
policy_revisionand updating the fieldpolicy_idon the agent, so during the next checkin we will send a newPOLICY_CHANGEaction that the agent will use.With long polling the agent is going to wait until the long polling timeout duration to do a new checkin, this cause policy reassign to be extremely long.
I think we can fix that by introducing new kind of actions
INTERNAL_*andINTERNAL_POLICY_REASSIGN.When we reassign an agent we can create a new action
INTERNAL_POLICY_REASSIGNthat will be get during the long polling (we check for new agent actions every 3 seconds) and we can use that action to refresh the agent and distribute thePOLICY_CHANGEaction.Not sure it's the best solution to that problem.
In progress