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

[Task Manager] Add caching to the task partitioning logic #189119

Closed
3 tasks
mikecote opened this issue Jul 24, 2024 · 1 comment · Fixed by #189562
Closed
3 tasks

[Task Manager] Add caching to the task partitioning logic #189119

mikecote opened this issue Jul 24, 2024 · 1 comment · Fixed by #189562
Assignees
Labels
Feature:Task Manager Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)

Comments

@mikecote
Copy link
Contributor

The Kibana discovery service provides an API to get a list of discovered Kibana nodes. The Task Manager calls this API during every claiming cycle to determine which partitions to query for when using the mget task claiming strategy.

const partitions = await taskPartitioner.getPartitions();

This adds more load to Elasticsearch when the polling interval is lowered for each Kibana node, and then all the node's assigned partitions are recalculated every time.

Proposed Solution

Within the task partitioning logic, we add a mechanism that keeps the node's calculated partitions in cache for 10 seconds before calling the discovery service again and recalculating them.

Definition of Done

  • The kibana assigned partitions are kept in memory for 10s
  • Requests errors to the discovery service are not cached (and rather retried on the next call)
  • Tests
@mikecote mikecote added Feature:Task Manager Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) labels Jul 24, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Task Manager Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants