Disabling upgrade mode must wait for tasks to not have AWAITING UPGRADE assignment – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 8-8.9

Briefly, this error occurs when you try to disable the upgrade mode while there are still tasks assigned with the AWAITING UPGRADE status. Elasticsearch won’t allow you to disable the upgrade mode until all tasks have completed their upgrade process. To resolve this issue, you can either wait for all tasks to complete their upgrade process or manually intervene to complete the tasks. Be cautious with manual intervention as it may lead to data inconsistency or loss if not handled properly. Always ensure to have a backup before performing any manual operations.

This guide will help you check for common problems that cause the log ” Disabling upgrade mode; must wait for tasks to not have AWAITING_UPGRADE assignment ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin, upgrade.

Log Context

Log “Disabling upgrade mode; must wait for tasks to not have AWAITING_UPGRADE assignment” classname is TransportSetUpgradeModeAction.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

            // Did we change from disabled -> enabled?
            if (request.isEnabled()) {
                logger.info("Enabling upgrade mode; must isolate datafeeds");
                isolateDatafeeds(tasksCustomMetadata; isolateDatafeedListener);
            } else {
                logger.info("Disabling upgrade mode; must wait for tasks to not have AWAITING_UPGRADE assignment");
                persistentTasksService.waitForPersistentTasksCondition(
                    // Wait for jobs; datafeeds and analytics not to be "Awaiting upgrade"
                    persistentTasksCustomMetadata -> persistentTasksCustomMetadata.tasks()
                        .stream()
                        .noneMatch(t -> ML_TASK_NAMES.contains(t.getTaskName()) && t.getAssignment().equals(AWAITING_UPGRADE));

 

 [ratemypost]