Relocation of shards causes bulk indexing client to hang, closes #1839.

This commit is contained in:
Shay Banon 2012-04-05 20:25:53 +03:00
parent c26934be36
commit 824b0bd347
1 changed files with 2 additions and 1 deletions

View File

@ -452,7 +452,7 @@ public abstract class TransportShardReplicationOperationAction<Request extends S
public void handleException(TransportException exp) { public void handleException(TransportException exp) {
// if we got disconnected from the node, or the node / shard is not in the right state (being closed) // if we got disconnected from the node, or the node / shard is not in the right state (being closed)
if (exp.unwrapCause() instanceof ConnectTransportException || exp.unwrapCause() instanceof NodeClosedException || if (exp.unwrapCause() instanceof ConnectTransportException || exp.unwrapCause() instanceof NodeClosedException ||
exp.unwrapCause() instanceof IllegalIndexShardStateException) { retryPrimaryException(exp)) {
primaryOperationStarted.set(false); primaryOperationStarted.set(false);
// we already marked it as started when we executed it (removed the listener) so pass false // we already marked it as started when we executed it (removed the listener) so pass false
// to re-add to the cluster listener // to re-add to the cluster listener
@ -530,6 +530,7 @@ public abstract class TransportShardReplicationOperationAction<Request extends S
} catch (Exception e) { } catch (Exception e) {
// shard has not been allocated yet, retry it here // shard has not been allocated yet, retry it here
if (retryPrimaryException(e)) { if (retryPrimaryException(e)) {
primaryOperationStarted.set(false);
retry(fromDiscoveryListener, null); retry(fromDiscoveryListener, null);
return; return;
} }