-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Description
It seems possible when users upgrade to 7.4 that an old version of Kibana re-inserts tasks within the .kibana_task_manager index without the id prefix of task:. When this scenario happens, task manager would get in an infinite loop attempting to claim those tasks but doing the update call on the object containing the prefix (task:).
For example, a task with id of oss_telemetry-vis_telemetry would cause task manager to attempt claiming a task with an id of task:oss_telemetry-vis_telemetry. This would cause a 409 to be returned since the version returned on read doesn't match the document version of the other.
In 7.4, it would cause for example 200 update requests per second of attempting to claim a task while constantly getting a 409 as a result. In 7.5 the issue isn't as severe but every 30 seconds a log like this shows up: [error][task_manager] Failed to mark Task vis_telemetry "oss_telemetry-vis_telemetry" as running: Task has been claimed by another Kibana service.
We should make sure when searching / claiming tasks that we also make sure they're saved objects. Similar to how the migrator only migrates documents that are saved objects: https://github.com/elastic/kibana/blob/master/src/core/server/saved_objects/migrations/core/migrate_raw_docs.ts#L41.
Could be similar to a 7.1 issue? #47607