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 :

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
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)) {
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)) {
         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)) {




 

 [ratemypost]

Opster
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.