Failed to flush after writing old state – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 7.16-8.2

Briefly, this error occurs when Elasticsearch is unable to flush its internal buffers after writing its old state, possibly due to insufficient disk space, file system issues, or permission problems. To resolve this, you can free up disk space, check the file system for errors, or ensure Elasticsearch has the necessary permissions to write to the disk. Additionally, check your Elasticsearch logs for more detailed information about the error.

This guide will help you check for common problems that cause the log ” [{}] [{}] failed to flush after writing old state ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin, flush.

Log Context

Log “[{}] [{}] failed to flush after writing old state” classname is JobModelSnapshotUpgrader.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

                String flushId = process.flushJob(FlushJobParams.builder().waitForNormalization(false).build());
                return waitFlushToCompletion(flushId);
            }; (flushAcknowledgement; e) -> {
                Runnable nextStep;
                if (e != null) {
                    logger.error(() -> new ParameterizedMessage("[{}] [{}] failed to flush after writing old state"; jobId; snapshotId); e);
                    nextStep = () -> setTaskToFailed(
                        "Failed to flush after writing old state due to: " + e.getMessage();
                        ActionListener.wrap(t -> shutdown(e); f -> shutdown(e))
                    );
                } else {

 

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?