Skip to content

GET _cat/pending_tasks will return some pending tasks that have been executed #48925

@kkewwei

Description

@kkewwei

ES_VERSION: 7.3.1
Description of the problem including expected versus actual behavior:
We can get pending tasks from cluster by GET _cat/pending_tasks, it should return the tasks that status are pending or starting. Actually, it will return some pending tasks that have being executed.

As we know that master will receive the requests from data nodes that shards have been started, then it will update ClusterState about those shards. If there are some another shard-started tasks pending at the same time, master will batch execute those shard-started tasks together, the processed status of shard-started tasks will been set true, but they are still exist in PrioritizedEsThreadPoolExecutor.workQueue, so if we get the pending tasks by GET _cat/pending_tasks, it will return the shard-started tasks that have been executed.

Solution:
If we should filter those shard-started tasks whether they have been executed before return?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions