📣 极限科技诚招搜索运维工程师(Elasticsearch/Easysearch)- 全职/北京 👉 : 立即申请加入

版本: 6.8-8.9

简而言之,当Elasticsearch尝试重新分配具有特定ID的任务,但该任务在任务管理索引中已不存在时,会出现此错误。这可能是由于任务已被删除或已完成。要解决此问题,您可以在尝试重新分配任务之前检查该任务是否仍在运行。如果任务未运行,您可以创建一个新任务并分配它。此外,请确保您的任务管理系统正常工作,不会过早删除任务。

日志上下文 #

日志 “cannot reassign task with id {” + taskId + “}; the task no longer exists” 的类名是 PersistentTasksCustomMetadata.java. 我们从Elasticsearch源代码中提取了以下内容,供那些寻求深入上下文的人参考:

PersistentTasktaskInProgress = tasks.get(taskId);
 if (taskInProgress != null) {
 changed = true;
 tasks.put(taskId; new PersistentTask<>(taskInProgress; getNextAllocationId(); assignment));
 } else {
 throw new ResourceNotFoundException("cannot reassign task with id {" + taskId + "}; the task no longer exists");
 }
 return this;
 }  /**