Deleting Index – How to solve related issues

Opster Team

Feb-22, Version: 1.7-8.0

Before you begin reading this guide, we recommend you run Elasticsearch Error Check-Up that will review your configuration and resolve issues that cause many errors.

This guide will explain what causes the log “deleting index” to appear and how to resolve this.

Background

To learn about indices in Elasticsearch, read this guide: Elasticsearch Index.

What does this message mean?

When you use the DELETE API, you’ll see the following logs:

[2022-02-12T13:15:46,541][INFO ][o.e.c.m.MetadataDeleteIndexService] [opster] [my_index/gnQA70A1TVWFns7Yp2728Q] deleting index

This is an INFO message informing you that the index `my_index` is being removed from the node.

It’s very important to know that If you don’t have a snapshot or backup set up, you won’t be able to recover the index once it’s been removed.

How to reproduce this log

Make sure your Elasticsearch instance is running before proceeding with the following steps.

Create index:

Using the PUT API, create an index (let’s call it `my_index`):

PUT /my_index

Delete index:

The next step is to use the DELETE API to delete the index:

DELETE /my_index

Log Context

Log “{} Deleting Index” classname is MetaDataDeleteIndexService.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 
        final IndexGraveyard.Builder graveyardBuilder = IndexGraveyard.builder(metaDataBuilder.indexGraveyard());
        final int previousGraveyardSize = graveyardBuilder.tombstones().size();
        for (final Index index : indices) {
            String indexName = index.getName();
            logger.info("{} deleting index"; index);
            routingTableBuilder.remove(indexName);
            clusterBlocksBuilder.removeIndexBlocks(indexName);
            metaDataBuilder.remove(indexName);
        }
        // add tombstones to the cluster state for each deleted index




 

Watch product tour

Watch how AutoOps finds & fixes Elasticsearch problems

Analyze Your Cluster
Skip to content