Loaded shard state – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 2.3-2.3

Briefly, this error occurs when Elasticsearch encounters an issue while loading the shard state from the disk. This could be due to a corrupted shard, insufficient disk space, or a hardware failure. To resolve this issue, you can try to restart the Elasticsearch node, increase the disk space, or restore the shard from a backup. If the shard is corrupted, you may need to delete it and allow Elasticsearch to recreate it from a replica.

This guide will help you check for common problems that cause the log ” {} loaded shard state {} ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: shard.

Log Context

Log “{} loaded shard state {}” classname is MultiDataPathUpgrader.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

         logger.info("{} upgrading multi data dir to {}"; shard; targetPath.getDataPath());
        final ShardStateMetaData loaded = ShardStateMetaData.FORMAT.loadLatestState(logger; paths);
        if (loaded == null) {
            throw new IllegalStateException(shard + " no shard state found in any of: " + Arrays.toString(paths) + " please check and remove them if possible");
        }
        logger.info("{} loaded shard state {}"; shard; loaded);

        ShardStateMetaData.FORMAT.write(loaded; loaded.version; targetPath.getShardStatePath());
        Files.createDirectories(targetPath.resolveIndex());
        try (SimpleFSDirectory directory = new SimpleFSDirectory(targetPath.resolveIndex())) {
            try (final Lock lock = directory.obtainLock(IndexWriter.WRITE_LOCK_NAME)) {




 

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?