Deleting model alias that refers to model – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 7.13-8.9

Briefly, this error occurs when you attempt to delete an alias in Elasticsearch that is still referring to a model. An alias is a secondary name used to refer to indices and deleting an alias that is still in use can cause issues. To resolve this, you can either update the alias to refer to a different model before deleting it, or ensure that the model it refers to is no longer in use. Alternatively, you can use the ‘remove’ action in the ‘update_aliases’ API to safely remove the alias.

This guide will help you check for common problems that cause the log ” deleting model_alias [{}] that refers to model [{}] ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin.

Log Context

Log “deleting model_alias [{}] that refers to model [{}]” classname is TransportDeleteTrainedModelAliasAction.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

                request.getModelAlias()
            );
        }
        final ClusterState.Builder builder = ClusterState.builder(currentState);
        final Map newMetadata = new HashMap(currentMetadata.modelAliases());
        logger.info("deleting model_alias [{}] that refers to model [{}]"; request.getModelAlias(); request.getModelId());
        inferenceAuditor.info(referencedModel; String.format(Locale.ROOT; "deleting model_alias [%s]"; request.getModelAlias()));

        newMetadata.remove(request.getModelAlias());
        final ModelAliasMetadata modelAliasMetadata = new ModelAliasMetadata(newMetadata);
        builder.metadata(Metadata.builder(currentState.getMetadata()).putCustom(ModelAliasMetadata.NAME; modelAliasMetadata).build());

 

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?