Skip authentication and warn if shards of the .security index are not available

Original commit: elastic/x-pack-elasticsearch@9970d80f2d
This commit is contained in:
Simon Willnauer 2016-10-28 15:04:06 +02:00
parent e67847ca8c
commit f696ad1d10
1 changed files with 3 additions and 1 deletions

View File

@ -21,6 +21,7 @@ import org.elasticsearch.action.search.MultiSearchResponse;
import org.elasticsearch.action.search.MultiSearchResponse.Item;
import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.support.ThreadedActionListener;
import org.elasticsearch.action.support.TransportActions;
import org.elasticsearch.cluster.ClusterChangedEvent;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.ClusterStateListener;
@ -428,7 +429,8 @@ public class NativeRolesStore extends AbstractComponent implements ClusterStateL
@Override
public void onFailure(Exception e) {
if (e instanceof IndexNotFoundException) { // if the index is not there we just claim the role is not there
// if the index or the shard is not there / available we just claim the role is not there
if (TransportActions.isShardNotAvailableException(e)) {
logger.warn((Supplier<?>) () -> new ParameterizedMessage("failed to load role [{}] index not available",
roleId), e);
roleActionListener.onResponse(RoleAndVersion.NON_EXISTENT);