Clear cluster pending tasks


We use Elasticsearch 1.7.0.
Currently, we have problems with big number of pending tasks (~17K pending tasks). Some of the tasks have been in the queue for >5 hours. We know it is most likely because of a dynamic mapping implemented to an index that causes really big index mapping.
The cluster health is still green. But, the cluster cannot accept any search requests. Elasticsearch-head plugin also doesn't work.

Is there any API to remove/clear pending tasks? How do you normally deal with very high pending tasks?

Thank you very much.


The only way is to restart the entire cluster.

Thank you very much @warkolm for the reply.
It was a delete mapping type command that block all other task, and the deleted mapping is a huge mapping. We realized this mapping was wrong, and tried to delete it, but we used wrong way to delete the index. Lesson learned.

After waiting for more than 12 hours, we finally restarted the cluster. It works.
Initially we afraid that the pending tasks will be reloaded and re-queued after cluster restart. It did not happen.

1 Like