-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
Only log warning when actually failing shards #28558
Conversation
@@ -188,6 +189,7 @@ public ClusterState applyFailedShards(final ClusterState clusterState, final Lis | |||
if (failedShardEntry.markAsStale()) { | |||
allocation.removeAllocationId(failedShard); | |||
} | |||
logger.warn(new ParameterizedMessage("failing shard [{}]", failedShardEntry), failedShardEntry.getFailure()); |
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.
also add logging information for the "mark as stale" part here as well as in removeStaleIdsWithoutRoutings?
@ywelsch, I've added a logging for |
@@ -238,6 +239,11 @@ public static ClusterState removeStaleIdsWithoutRoutings(ClusterState clusterSta | |||
} | |||
indexMetaDataBuilder.putInSyncAllocationIds(shardNumber, remainingInSyncAllocations); | |||
} | |||
// Only log the stale shards which have been actually removed. | |||
if (oldInSyncAllocations.size() != remainingInSyncAllocations.size()) { |
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.
This check is not necessary. idsToRemove
already contains the info that's needed (it does not contain non-existing ids, you can even add an assertion for that if you like).
Also I would change the message to "{} marking unavailable shards as stale: {}"
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.
I pushed b0cd954
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.
LGTM
Thanks @ywelsch for reviewing. |
Currently the master node logs a warning message whenever it receives a failed shard request. However, this can be noisy because - Multiple failed shard requests can be issued for a single shard - Failed shard requests can be still issued for an already failed shard This commit moves the log-warn to AllocationService in which the failing shard action actually happens. This is another prerequisite step in order to not ignore the shard not-available exceptions in the replication. Relates #28534
Currently the master node logs a warning message whenever it receives a failed shard request. However, this can be noisy because
This commit moves the log-warn to AllocationService in which the failing shard action actually happens. This is another prerequisite step in order to not ignore the shard not-available exceptions in the replication.
Relates #28534