Briefly, this error occurs when Elasticsearch is unable to maintain the assignment of persistent tasks to nodes due to issues like node failure, network disconnection, or resource constraints. To resolve this, you can try the following: 1) Check the health of your nodes and ensure they are running properly. 2) Verify your network connectivity. 3) Ensure your cluster has sufficient resources to handle the tasks. 4) Review your task assignment settings and adjust them if necessary. 5) If the problem persists, consider increasing the cluster size or optimizing your tasks to use fewer resources.
This guide will help you check for common problems that cause the log ” Un-assigning persistent tasks : ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin, persistent.
Overview
In Elasticsearch, persistent refers to cluster settings that persist across cluster restarts. This setting is used in Cluster Update API calls. Persistent settings can also be configured in the elasticsearch.yml file.
Examples
## enable shard routing PUT /_cluster/settings { "persistent" : { "cluster.routing.allocation.enable" : "all" } } ## enable rebalancing of shards PUT /_cluster/settings { "persistent" : { "cluster.routing.rebalance.enable" : "all" } } ## limit the heap size for fielddata PUT /_cluster/settings { "persistent" : { “indices.breaker.fielddata.limit”: "30%" } }
Log Context
Log “Un-assigning persistent tasks : ” classname is TransportSetUpgradeModeAction.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :
// We want to always have the same ordering of which tasks we un-allocate first. // However; the order in which the distributed tasks handle the un-allocation event is not guaranteed. .sorted(Comparator.comparing(PersistentTask::getTaskName)) .collect(Collectors.toList()); logger.info("Un-assigning persistent tasks : " + mlTasks.stream().map(PersistentTask::getId).collect(Collectors.joining("; "; "[ "; " ]"))); TypedChainTaskExecutor> chainTaskExecutor = new TypedChainTaskExecutor(client.threadPool().executor(executor); r -> true;
[ratemypost]