Starting template upgrade to version templates will be updated and will be removed – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 6.8-7.15

Briefly, this error occurs when Elasticsearch is upgrading to a new version and it needs to update or remove some existing templates. This is a normal part of the upgrade process and not necessarily an error. However, if it causes issues, you can resolve it by manually updating or deleting the templates before starting the upgrade. Alternatively, you can backup your templates before the upgrade and restore them afterwards if necessary. Also, ensure that your new version of Elasticsearch supports the templates you are using.

In addition we recommend you run the Elasticsearch Template Optimizer to fix problems in your data modeling.

It will analyze your templates to detect issues and improve search performance, reduce indexing bottlenecks and optimize storage utilization. The Template Optimizer is free and requires no installation.

Log Context

Log “Starting template upgrade to version {}; {} templates will be updated and {} will be removed” classname is TemplateUpgradeService.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

        lastTemplateMetadata = templates;
        Optional; Set>> changes = calculateTemplateChanges(templates);
        if (changes.isPresent()) {
            if (upgradesInProgress.compareAndSet(0; changes.get().v1().size() + changes.get().v2().size() + 1)) {
                logger.info("Starting template upgrade to version {}; {} templates will be updated and {} will be removed";
                    Version.CURRENT;
                    changes.get().v1().size();
                    changes.get().v2().size());

                assert threadPool.getThreadContext().isSystemContext();

 

How helpful was this guide?

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?