Replace FailedToCommitClusterStateException with NotMasterException #136083
+2
−8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the fifth part of a series of PRs fixing how the
FailedToCommitClusterStateException
is used in ElasticSearch. As per #135017,FailedToCommitClusterStateException
is defined as:Currently,
FailedToCommitClusterStateException
is used as a 'catch-all' exception thrown at multiple places throughout theCoordinator
andMasterService
during the publication process. Semantically however, it doesn't make sense to throw this exception before the cluster state update is actually sent over the wire, since at this point, we know for certain that the cluster state update failed.FailedToCommitClusterStateException
is intended to display ambiguity.This work is a pre-requisite to #134213.
Changes
Replaces the
FailedToCommitClusterStateException
insideMasterService .BatchingTaskQueue.submitTask
with aNotMasterException
. This exception is thrown when the threadpools are shutting down, which occurs when the node itself is shutting down, hence it is no longer the current master. As a note, since there is an assert false, this cannot happen in practice.Next Steps
The goal of this work is to fix up all erroneously used
FailedToCommitClusterStateException
.Done:
FailedToCommitClusterStateException
thrown insideMasterService.Batch.onResponse()
when draining the queue after the threadpool has shut down - Change FailedToCommitClusterStateException to NotMasterException #135008FailedToCommitClusterStateException
toNotMasterException
during the pre-publication process: Changes FailedToCommitClusterStateException to NotMasterException #135548FailedToCommitClusterStateExceptions
prior to the publication of the cluster state update over the wire withFailedToPublishClusterStateException
: Replace pre publication failed to commit cluster state exceptions #135706FailedToCommitClusterStateException
: Remove FailedToCommitClusterStateException Check #135846Todo:
FailedToCommitClusterStateException
that need to be updatedRelates to: ES-13061