New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wait for mappings to be available on the primary before indexing. #10949
Wait for mappings to be available on the primary before indexing. #10949
Conversation
@@ -152,7 +165,8 @@ protected TransportRequestOptions transportOptions() { | |||
} | |||
|
|||
protected boolean retryPrimaryException(Throwable e) { | |||
return TransportActions.isShardNotAvailableException(e); | |||
return e.getClass() == RetryOnPrimaryException.class |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we subclass IllegalIndexShardStateException
instead of IndexShardException
then we don't need to change retryPrimaryException
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I'll do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually IllegalIndexShardStateException seems to be about shards not being in the right shard state (STARTED, RECOVERING, ...) which does not seem to apply here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok fair enough....
left 2 comments LGTM in general |
@s1monw I initially liked the idea of reusing IllegalIndexShardStateException but this one is more about shards being eg. not started yet, while in this case the shard is started and working, it just happens to not have the latest version of the cluster state. |
…exing. In some cases it might happen that a mapping which is already available on the master node is not available yet on the node that holds the primary shard. This commit changes indexing on the primary shard so that if a dynamic update is triggered then the index operation is re-tried until required mappings are available locally (using cluster state observing).
9917ef6
to
8a19bf3
Compare
Mappings: Wait for mappings to be available on the primary before indexing.
In some cases it might happen that a mapping which is already available on the
master node is not available yet on the node that holds the primary shard.
This commit changes indexing on the primary shard so that if a dynamic update
is triggered then the index operation is re-tried until required mappings are
available locally (using cluster state observing).