Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jakelandis committed Oct 4, 2023
1 parent 7d2c037 commit 12c0df3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1791,8 +1791,8 @@ private void sourceIndicesWithTokensAndRun(ActionListener<List<String>> listener
final SecurityIndexManager frozenTokensIndex = securityTokensIndex.defensiveCopy();
if (frozenTokensIndex.indexExists()) {
// an existing tokens index always contains tokens (if available and version allows)
if (false == frozenTokensIndex.isAvailable(PRIMARY_SHARDS)) {
listener.onFailure(frozenTokensIndex.getUnavailableReason(PRIMARY_SHARDS));
if (false == frozenTokensIndex.isAvailable(SEARCH_SHARDS)) {
listener.onFailure(frozenTokensIndex.getUnavailableReason(SEARCH_SHARDS));
return;
}
if (false == frozenTokensIndex.isIndexUpToDate()) {
Expand All @@ -1814,8 +1814,8 @@ private void sourceIndicesWithTokensAndRun(ActionListener<List<String>> listener
if (false == frozenTokensIndex.indexExists()
|| frozenTokensIndex.getCreationTime()
.isAfter(clock.instant().minus(ExpiredTokenRemover.MAXIMUM_TOKEN_LIFETIME_HOURS, ChronoUnit.HOURS))) {
if (false == frozenMainIndex.isAvailable(PRIMARY_SHARDS)) {
listener.onFailure(frozenMainIndex.getUnavailableReason(PRIMARY_SHARDS));
if (false == frozenMainIndex.isAvailable(SEARCH_SHARDS)) {
listener.onFailure(frozenMainIndex.getUnavailableReason(SEARCH_SHARDS));
return;
}
if (false == frozenMainIndex.isIndexUpToDate()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ public void getUsers(String[] userNames, final ActionListener<Collection<User>>
final SecurityIndexManager frozenSecurityIndex = this.securityIndex.defensiveCopy();
if (frozenSecurityIndex.indexExists() == false) {
listener.onResponse(Collections.emptyList());
} else if (frozenSecurityIndex.isAvailable(SEARCH_SHARDS) == false) {
listener.onFailure(frozenSecurityIndex.getUnavailableReason(SEARCH_SHARDS));
} else if (frozenSecurityIndex.isAvailable(PRIMARY_SHARDS) == false) {
listener.onFailure(frozenSecurityIndex.getUnavailableReason(PRIMARY_SHARDS));
} else if (userNames.length == 1) { // optimization for single user lookup
final String username = userNames[0];
getUserAndPassword(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ private Tuple<Boolean, Boolean> checkIndexAvailable(ClusterState state) {
}
if (allPrimaryShards == false || searchShards == false) {
logger.debug(
"Index [{}] is not fully available." + " all primary shards available [{}], search shards available, [{}]",
"Index [{}] is not fully available. all primary shards available [{}], search shards available, [{}]",
aliasName,
allPrimaryShards,
searchShards
Expand Down

0 comments on commit 12c0df3

Please sign in to comment.