Maximum snapshot retention deletion time reached time spent – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 7.5-7.1

Briefly, this error occurs when the time spent on deleting old snapshots in Elasticsearch exceeds the maximum snapshot retention deletion time. This could be due to a large number of snapshots or slow disk I/O. To resolve this issue, you can increase the maximum snapshot retention deletion time, reduce the number of snapshots, or improve the disk I/O performance. Also, ensure that the Elasticsearch cluster is not under heavy load, which could slow down the deletion process.

This guide will help you check for common problems that cause the log ” maximum snapshot retention deletion time reached; time spent: [{}]; ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: snapshot, plugin.

Log Context

Log “maximum snapshot retention deletion time reached; time spent: [{}];” classname is SnapshotRetentionTask.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
long finishTime = nowNanoSupplier.getAsLong();
TimeValue deletionTime = TimeValue.timeValueNanos(finishTime - deleteStartTime);
logger.debug("elapsed time for deletion of [{}] snapshot: {}"; info.snapshotId(); deletionTime);
TimeValue totalDeletionTime = TimeValue.timeValueNanos(finishTime - startTime);
if (totalDeletionTime.compareTo(maximumTime) > 0) {
logger.info("maximum snapshot retention deletion time reached; time spent: [{}];" +
" maximum allowed time: [{}]; deleted [{}] out of [{}] snapshots scheduled for deletion; failed to delete [{}]";
totalDeletionTime; maximumTime; deleted; count; failed);
slmStats.deletionTime(totalDeletionTime);
slmStats.retentionTimedOut();
return;
long finishTime = nowNanoSupplier.getAsLong(); TimeValue deletionTime = TimeValue.timeValueNanos(finishTime - deleteStartTime); logger.debug("elapsed time for deletion of [{}] snapshot: {}"; info.snapshotId(); deletionTime); TimeValue totalDeletionTime = TimeValue.timeValueNanos(finishTime - startTime); if (totalDeletionTime.compareTo(maximumTime) > 0) { logger.info("maximum snapshot retention deletion time reached; time spent: [{}];" + " maximum allowed time: [{}]; deleted [{}] out of [{}] snapshots scheduled for deletion; failed to delete [{}]"; totalDeletionTime; maximumTime; deleted; count; failed); slmStats.deletionTime(totalDeletionTime); slmStats.retentionTimedOut(); return;
long finishTime = nowNanoSupplier.getAsLong();
                TimeValue deletionTime = TimeValue.timeValueNanos(finishTime - deleteStartTime);
                logger.debug("elapsed time for deletion of [{}] snapshot: {}"; info.snapshotId(); deletionTime);
                TimeValue totalDeletionTime = TimeValue.timeValueNanos(finishTime - startTime);
                if (totalDeletionTime.compareTo(maximumTime) > 0) {
                    logger.info("maximum snapshot retention deletion time reached; time spent: [{}];" +
                            " maximum allowed time: [{}]; deleted [{}] out of [{}] snapshots scheduled for deletion; failed to delete [{}]";
                        totalDeletionTime; maximumTime; deleted; count; failed);
                    slmStats.deletionTime(totalDeletionTime);
                    slmStats.retentionTimedOut();
                    return;

 

 [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.