From eef505ed51c8866f80f7b4aec7e4905206f364b1 Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Fri, 16 May 2014 14:03:18 +0200 Subject: [PATCH] RecoveryID should not be a per JVM but per Node Today the RecovyerID is taken from a static atomic long which is essentially a per JVM ID. We run the tests within the same JVM and that means we don't really simulate what happens in production environments. Instead we should use a per node generated ID. --- .../indices/cluster/IndicesClusterStateService.java | 4 +++- .../indices/recovery/StartRecoveryRequest.java | 6 ++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/elasticsearch/indices/cluster/IndicesClusterStateService.java b/src/main/java/org/elasticsearch/indices/cluster/IndicesClusterStateService.java index c3e71589e7d..e2799c3af82 100644 --- a/src/main/java/org/elasticsearch/indices/cluster/IndicesClusterStateService.java +++ b/src/main/java/org/elasticsearch/indices/cluster/IndicesClusterStateService.java @@ -69,6 +69,7 @@ import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.atomic.AtomicLong; import static com.google.common.collect.Maps.newHashMap; import static org.elasticsearch.ExceptionsHelper.detailedMessage; @@ -108,6 +109,7 @@ public class IndicesClusterStateService extends AbstractLifecycleComponent existingFiles, RecoveryState.Type recoveryType) { - this.recoveryId = recoveryIdGenerator.incrementAndGet(); + StoreFileMetaData> existingFiles, RecoveryState.Type recoveryType, long recoveryId) { + this.recoveryId = recoveryId; this.shardId = shardId; this.sourceNode = sourceNode; this.targetNode = targetNode;