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 :
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]