diff --git a/src/main/java/org/elasticsearch/index/engine/internal/InternalEngine.java b/src/main/java/org/elasticsearch/index/engine/internal/InternalEngine.java index f661f5a4ca8..02860063115 100644 --- a/src/main/java/org/elasticsearch/index/engine/internal/InternalEngine.java +++ b/src/main/java/org/elasticsearch/index/engine/internal/InternalEngine.java @@ -339,8 +339,13 @@ public class InternalEngine implements Engine { final IndexWriter writer; try (InternalLock _ = readLock.acquire()) { writer = currentIndexWriter(); - try (Releasable r = throttle.acquireThrottle()) { + if (create.origin() == Operation.Origin.RECOVERY) { + // Don't throttle recovery operations innerCreate(create, writer); + } else { + try (Releasable r = throttle.acquireThrottle()) { + innerCreate(create, writer); + } } dirty = true; flushNeeded = true; @@ -351,7 +356,6 @@ public class InternalEngine implements Engine { checkVersionMapRefresh(); } - private void innerCreate(Create create, IndexWriter writer) throws IOException { if (engineConfig.isOptimizeAutoGenerateId() && create.autoGeneratedId() && !create.canHaveDuplicates()) { // We don't need to lock because this ID cannot be concurrently updated: @@ -443,8 +447,13 @@ public class InternalEngine implements Engine { final IndexWriter writer; try (InternalLock _ = readLock.acquire()) { writer = currentIndexWriter(); - try (Releasable r = throttle.acquireThrottle()) { + if (index.origin() == Operation.Origin.RECOVERY) { + // Don't throttle recovery operations innerIndex(index, writer); + } else { + try (Releasable r = throttle.acquireThrottle()) { + innerIndex(index, writer); + } } dirty = true; flushNeeded = true;