Dropping index due to conflict with – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 6.8-6.8

Briefly, this error occurs when there’s a conflict between the existing index and a new one that Elasticsearch is trying to create. This could be due to a naming conflict or a conflict in the index settings. To resolve this issue, you can either rename the new index, delete the existing index if it’s no longer needed, or adjust the settings of the new index to avoid the conflict. Additionally, ensure that your indexing operations are properly sequenced to avoid such conflicts in the future.

This log could be avoided if detected earlier. Before you read this guide, we recommend you run the Elasticsearch Error Check-Up which detects issues in ES that cause log errors. The Check-Up includes checks that would help you prevent the drop of an index due to conflict with a tribe node. It’s a free tool that requires no installation and takes 2 minutes to complete. You can run the Check-Up here.  



This guide will help you understand common problems that cause the log “Dropping index due to conflict with” to appear. It’s important to be familiar with the issues related to the log, so to get started, read the general overview on common issues and tips related to the relevant Elasticsearch concepts: index and tribe.

Quick Overview

This error arises when:

  1. Tribe nodes are used to search across multiple clusters,
  2. An index with the same name exists in multiple clusters, and
  3. The value tribe.on_conflict the setting is to drop.

Why this Log Appears 

Tribe nodes used to act as a client for searching across multiple clusters, but they were deprecated in Elasticsearch version 5.4 in favor of a cross-cluster search feature. The tribe node retrieves the state of all the connected clusters and merges them in a common global state. It performs read and write operations to all the clusters while they’re in a local state. This feature raises a limitation as well. In a single cluster state, the name of each index must be unique. If there are duplicate index names, then the tribe node by default selects only one index unless its behavior is modified to drop, in which case it drops the index altogether.

Impact and Effect

This log means that an index is dropped from the state of the local state of the tribe node and hence stops being searchable.

How to Fix and Prevent 

  • Use tribe.on_conflict setting to let the tribe node know what to do when there is an index name conflict across multiple clusters. The default value of this setting is set to any, but can also be set to prefer_[tribeName].
  • Consider upgrading to at least Elasticsearch version 5.4 or above with the cross-cluster-search feature instead of tribe nodes. This feature allows you to search indices with the same name inside different clusters without any conflict.

Log Context

Log “[{}] dropping index {} due to conflict with [{}]” classname is TribeService.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

                        if (ON_CONFLICT_ANY.equals(onConflict)) {
                            // we chose any tribe; carry on
                        } else if (ON_CONFLICT_DROP.equals(onConflict)) {
                            // drop the indices; there is a conflict
                            clusterStateChanged = true;
                            logger.info("[{}] dropping index {} due to conflict with [{}]"; tribeName; tribeIndex.getIndex();
                                    existingFromTribe);
                            removeIndex(blocks; metaData; routingTable; tribeIndex);
                            droppedIndices.add(indexName);
                        } else if (onConflict.startsWith(ON_CONFLICT_PREFER)) {
                            // on conflict; prefer a tribe...

 

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?