mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-26 06:46:10 +00:00
add origin to failure message
This commit is contained in:
parent
397f442c6d
commit
5b1f263569
@ -749,13 +749,13 @@ public class InternalIndexShard extends AbstractIndexShardComponent implements I
|
|||||||
// for primaries, we only allow to write when actually started (so the cluster has decided we started)
|
// for primaries, we only allow to write when actually started (so the cluster has decided we started)
|
||||||
// otherwise, we need to retry, we also want to still allow to index if we are relocated in case it fails
|
// otherwise, we need to retry, we also want to still allow to index if we are relocated in case it fails
|
||||||
if (state != IndexShardState.STARTED && state != IndexShardState.RELOCATED) {
|
if (state != IndexShardState.STARTED && state != IndexShardState.RELOCATED) {
|
||||||
throw new IllegalIndexShardStateException(shardId, state, "operation only allowed when started/recovering");
|
throw new IllegalIndexShardStateException(shardId, state, "operation only allowed when started/recovering, origin [" + origin + "]");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// for replicas, we allow to write also while recovering, since we index also during recovery to replicas
|
// for replicas, we allow to write also while recovering, since we index also during recovery to replicas
|
||||||
// and rely on version checks to make sure its consistent
|
// and rely on version checks to make sure its consistent
|
||||||
if (state != IndexShardState.STARTED && state != IndexShardState.RELOCATED && state != IndexShardState.RECOVERING && state != IndexShardState.POST_RECOVERY) {
|
if (state != IndexShardState.STARTED && state != IndexShardState.RELOCATED && state != IndexShardState.RECOVERING && state != IndexShardState.POST_RECOVERY) {
|
||||||
throw new IllegalIndexShardStateException(shardId, state, "operation only allowed when started/recovering");
|
throw new IllegalIndexShardStateException(shardId, state, "operation only allowed when started/recovering, origin [" + origin + "]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user