If the request contains wait_for_completion=false , Elasticsearch performs some preflight checks, launches the request, and returns a task you can use to cancel or get the status of the task. Elasticsearch creates a record of this task as a document at .tasks/task/${taskId} . When you are done with a task, you should delete the task document so Elasticsearch can reclaim the space.
However, I haven't found any information about how to delete task documents. All the task management APIs I've looked at only have the /get, /list, and /cancel. No /delete !
How do I delete a task from an elasticsearch cluster?
Is task cancellation the same thing as task deletion?
The task will have finished, so using the /cancel endpoint doesn't make a lot of sense to me. I need to use a /delete endpoint if I need to do what the docs suggest:
When you are done with a task, you should delete the task document so Elasticsearch can reclaim the space.
Interesting... I did not read your OP close enough, I have never deleted a task manually nor really thought about it because on the clusters I have the .tasks index is so small relative to my data indices.
Typically it is not recommended to operate on the . system indices directly perhaps this is still a valid case with tasks.
Perhaps @DavidTurner can comment on the manually deleting the task document.
I don't know much more than what you said. The .tasks index dates back to a time when manually deleting things would have been the only option. I see code for recording new task results (and retrieving them by ID) but I see no mechanism that would delete anything from this index so it looks like a manual delete is still the only option.
There's an issue open for the things left to do before we can stop calling the task management feature "experimental", but it's pretty far down the priority list right now:
I added the phrase "and a mechanism for cleaning up older results once no longer needed" in reaction to this conversation at least.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.