-
Notifications
You must be signed in to change notification settings - Fork 25.5k
Replace pre publication failed to commit cluster state exceptions #135706
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
Open
joshua-adams-1
wants to merge
14
commits into
elastic:main
Choose a base branch
from
joshua-adams-1:replace-pre-publication-failed-to-commit-cluster-state-exceptions
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+16
−11
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
0a0418d
Changes FailedToCommitClusterStateException to NotMasterException
joshua-adams-1 f2c836d
Add FailedToPublishClusterStateException
joshua-adams-1 350da55
Extend use of FailedToPublishClusterStateException
joshua-adams-1 eec4c8f
[CI] Update transport version definitions
812ce64
[CI] Auto commit changes from spotless
8df45c6
Spotless Apply
joshua-adams-1 01ffa86
Merge branch 'replace-pre-publication-failed-to-commit-cluster-state-…
joshua-adams-1 4911606
Trying to get transport definitions to work
joshua-adams-1 b76a1e5
Merge branch 'main' into replace-pre-publication-failed-to-commit-clu…
joshua-adams-1 7376b9d
Finally got transport definitions to work
joshua-adams-1 4152c42
Remove FailedToPublishClusterStateException and uses NotMasterException
joshua-adams-1 0eb27a8
Merge branch 'main' into replace-pre-publication-failed-to-commit-clu…
joshua-adams-1 f886182
Fix merge issues
joshua-adams-1 a277c2e
Fix merge issues
joshua-adams-1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -16,14 +16,19 @@ | |||||
import java.io.IOException; | ||||||
|
||||||
/** | ||||||
* Thrown when a cluster state publication fails to commit the new cluster state. If publication fails then a new master is elected but the | ||||||
* update might or might not take effect, depending on whether the newly-elected master accepted the published state that failed to | ||||||
* be committed. This exception should only be used when there is <i>ambiguity</i> whether a state update took effect or not. | ||||||
* | ||||||
* This is different from {@link NotMasterException} where we know for certain that a state update never took effect. | ||||||
* | ||||||
* This exception is retryable within {@link TransportMasterNodeAction}. | ||||||
* | ||||||
* Exception indicating a cluster state update was published but not committed to all nodes. | ||||||
* <p> | ||||||
* If this exception is thrown, then the cluster state update was published, but is not guaranteed | ||||||
* to be committed on any nodes, including the next master node. This exception should only be thrown when there is | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
* <i>ambiguity</i> whether a cluster state update has been committed. | ||||||
* <p> | ||||||
* For exceptions thrown prior to publication, | ||||||
* when the cluster update has <i>definitely</i> failed, use a different exception. | ||||||
* <p> | ||||||
* If during a cluster state update the node is no longer master, use a {@link NotMasterException} | ||||||
* <p> | ||||||
* This is a retryable exception inside {@link TransportMasterNodeAction} | ||||||
* <p> | ||||||
* See {@link ClusterStatePublisher} for more details. | ||||||
*/ | ||||||
public class FailedToCommitClusterStateException extends ElasticsearchException { | ||||||
|
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.
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.
Conceptual nit: "committed" is a global property rather than something that happens on one or more nodes.
This exception indicates the publishing master doesn't think the update was committed, but it cannot tell for sure. It depends on which other master nodes accepted it and the winner of the next election.