-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Description
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?