diff --git a/server/src/main/java/org/elasticsearch/common/ReferenceDocs.java b/server/src/main/java/org/elasticsearch/common/ReferenceDocs.java index 41faefaafc636..2567268415051 100644 --- a/server/src/main/java/org/elasticsearch/common/ReferenceDocs.java +++ b/server/src/main/java/org/elasticsearch/common/ReferenceDocs.java @@ -85,6 +85,7 @@ public enum ReferenceDocs { SECURE_SETTINGS, CLUSTER_SHARD_LIMIT, DEPLOY_CLOUD_DIFF_FROM_STATEFUL, + DELETE_INDEX_BLOCK, // this comment keeps the ';' on the next line so every entry above has a trailing ',' which makes the diff for adding new links cleaner ; diff --git a/server/src/main/resources/org/elasticsearch/common/reference-docs-links.txt b/server/src/main/resources/org/elasticsearch/common/reference-docs-links.txt index 50732d9289be5..5d8ae6c5498a5 100644 --- a/server/src/main/resources/org/elasticsearch/common/reference-docs-links.txt +++ b/server/src/main/resources/org/elasticsearch/common/reference-docs-links.txt @@ -47,3 +47,4 @@ ALLOCATION_EXPLAIN_MAX_RETRY troubleshoot/ela SECURE_SETTINGS deploy-manage/security/secure-settings CLUSTER_SHARD_LIMIT reference/elasticsearch/configuration-reference/miscellaneous-cluster-settings#cluster-shard-limit DEPLOY_CLOUD_DIFF_FROM_STATEFUL deploy-manage/deploy/elastic-cloud/differences-from-other-elasticsearch-offerings +DELETE_INDEX_BLOCK api/doc/elasticsearch/operation/operation-indices-remove-block diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/JobModelSnapshotUpgrader.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/JobModelSnapshotUpgrader.java index d42eb8f748b51..d270e00f78e12 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/JobModelSnapshotUpgrader.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/JobModelSnapshotUpgrader.java @@ -17,6 +17,7 @@ import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.client.internal.Client; import org.elasticsearch.common.CheckedSupplier; +import org.elasticsearch.common.ReferenceDocs; import org.elasticsearch.common.util.concurrent.AbstractRunnable; import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; import org.elasticsearch.common.util.concurrent.ThreadContext; @@ -196,15 +197,21 @@ private void deleteOlderSnapshotDoc(SearchResponse searchResponse, Consumer { - logger.warn( - () -> format( + logger.warn(() -> { + String baseMessage = format( "[%s] [%s] failed to delete old snapshot [%s] result document", jobId, snapshotId, ModelSizeStats.RESULT_TYPE_FIELD.getPreferredName() - ), - e - ); + ); + if (e instanceof org.elasticsearch.cluster.block.ClusterBlockException) { + return baseMessage + + ". Remove the write block from the results index to delete the model snapshot. See " + + ReferenceDocs.DELETE_INDEX_BLOCK + + " for details."; + } + return baseMessage; + }, e); }), () -> runAfter.accept(null))); }