Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.x] Remove stale tasks from task conflict count during task claiming (
#198416) (#198666) # Backport This will backport the following commits from `main` to `8.x`: - [Remove stale tasks from task conflict count during task claiming (#198416)](#198416) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Mike Côté","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-01T12:19:04Z","message":"Remove stale tasks from task conflict count during task claiming (#198416)\n\nIn this PR, I'm removing the count of stale tasks from the number of\r\nconflicts during the claiming cycle. I am also adding a new property to\r\nthe task manager health report (`claim_stale_tasks`) so we can track\r\nthose separately to ensure we have the proper page size.\r\n\r\n## To verify\r\nApply the following diff, observe the new `claim_stale_tasks` in the TM\r\nhealth API and that conflicts are 0\r\n```\r\ndiff --git a/x-pack/plugins/task_manager/server/task_claimers/strategy_mget.ts b/x-pack/plugins/task_manager/server/task_claimers/strategy_mget.ts\r\nindex 4e74454e8c9..35d7fd872d8 100644\r\n--- a/x-pack/plugins/task_manager/server/task_claimers/strategy_mget.ts\r\n+++ b/x-pack/plugins/task_manager/server/task_claimers/strategy_mget.ts\r\n@@ -145,6 +145,7 @@ async function claimAvailableTasks(opts: TaskClaimerOpts): Promise<ClaimOwnershi\r\n }\r\n\r\n if (\r\n+ false &&\r\n searchVersion.seqNo === latestVersion.seqNo &&\r\n searchVersion.primaryTerm === latestVersion.primaryTerm\r\n ) {\r\n```","sha":"37ebf29f87047e8b96e3c2cd378c647a4f2ca797","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Feature:Task Manager","Team:ResponseOps","v9.0.0","backport:prev-minor","v8.17.0"],"title":"Remove stale tasks from task conflict count during task claiming","number":198416,"url":"https://github.com/elastic/kibana/pull/198416","mergeCommit":{"message":"Remove stale tasks from task conflict count during task claiming (#198416)\n\nIn this PR, I'm removing the count of stale tasks from the number of\r\nconflicts during the claiming cycle. I am also adding a new property to\r\nthe task manager health report (`claim_stale_tasks`) so we can track\r\nthose separately to ensure we have the proper page size.\r\n\r\n## To verify\r\nApply the following diff, observe the new `claim_stale_tasks` in the TM\r\nhealth API and that conflicts are 0\r\n```\r\ndiff --git a/x-pack/plugins/task_manager/server/task_claimers/strategy_mget.ts b/x-pack/plugins/task_manager/server/task_claimers/strategy_mget.ts\r\nindex 4e74454e8c9..35d7fd872d8 100644\r\n--- a/x-pack/plugins/task_manager/server/task_claimers/strategy_mget.ts\r\n+++ b/x-pack/plugins/task_manager/server/task_claimers/strategy_mget.ts\r\n@@ -145,6 +145,7 @@ async function claimAvailableTasks(opts: TaskClaimerOpts): Promise<ClaimOwnershi\r\n }\r\n\r\n if (\r\n+ false &&\r\n searchVersion.seqNo === latestVersion.seqNo &&\r\n searchVersion.primaryTerm === latestVersion.primaryTerm\r\n ) {\r\n```","sha":"37ebf29f87047e8b96e3c2cd378c647a4f2ca797"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/198416","number":198416,"mergeCommit":{"message":"Remove stale tasks from task conflict count during task claiming (#198416)\n\nIn this PR, I'm removing the count of stale tasks from the number of\r\nconflicts during the claiming cycle. I am also adding a new property to\r\nthe task manager health report (`claim_stale_tasks`) so we can track\r\nthose separately to ensure we have the proper page size.\r\n\r\n## To verify\r\nApply the following diff, observe the new `claim_stale_tasks` in the TM\r\nhealth API and that conflicts are 0\r\n```\r\ndiff --git a/x-pack/plugins/task_manager/server/task_claimers/strategy_mget.ts b/x-pack/plugins/task_manager/server/task_claimers/strategy_mget.ts\r\nindex 4e74454e8c9..35d7fd872d8 100644\r\n--- a/x-pack/plugins/task_manager/server/task_claimers/strategy_mget.ts\r\n+++ b/x-pack/plugins/task_manager/server/task_claimers/strategy_mget.ts\r\n@@ -145,6 +145,7 @@ async function claimAvailableTasks(opts: TaskClaimerOpts): Promise<ClaimOwnershi\r\n }\r\n\r\n if (\r\n+ false &&\r\n searchVersion.seqNo === latestVersion.seqNo &&\r\n searchVersion.primaryTerm === latestVersion.primaryTerm\r\n ) {\r\n```","sha":"37ebf29f87047e8b96e3c2cd378c647a4f2ca797"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Mike Côté <[email protected]>
- Loading branch information