Deleting dangling index – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 1.7-1.7

Briefly, this error occurs when Elasticsearch identifies an index that is not associated with any cluster state. This is known as a dangling index. It usually happens due to abrupt cluster termination or disk space issues. To resolve this, you can manually delete the dangling index if it’s not needed. Alternatively, you can enable the automatic import of dangling indices by setting the ‘gateway.auto_import_dangling_indices’ to true. However, be cautious as this could lead to data inconsistency. Lastly, ensure your cluster is properly shut down to prevent this issue in the future.

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

Log Context

Log “[{}] deleting dangling index” classname is LocalGatewayMetaState.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

                 DanglingIndex remove = danglingIndices.remove(metaData.index());
                // no longer there...
                if (remove == null) {
                    return;
                }
                logger.warn("[{}] deleting dangling index"; metaData.index());
                try {
                    indicesService.deleteIndexStore("deleting dangling index"; metaData; clusterService.state());
                } catch (Exception ex) {
                    logger.debug("failed to delete dangling index"; ex);
                }




 

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?