forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cut PersistedState interface from GatewayMetaState (elastic#47001)
Today `GatewayMetaState` implements `PersistedState` but it's an error to use it as a `PersistedState` before it's been started, or if the node is master-ineligible. It also holds some fields that are meaningless on nodes that do not persist their states. Finally, it takes responsibility for both loading the original cluster state and some of the high-level logic for writing the cluster state back to disk. This commit addresses these concerns by introducing a more specific `PersistedState` implementation for use on master-eligible nodes which is only instantiated if and when it's appropriate. It also moves the fields and high-level persistence logic into a new `IncrementalClusterStateWriter` with a more appropriate lifecycle. Follow-up to elastic#46326 and elastic#46532 Forward-port of elastic#46655
- Loading branch information
1 parent
3fa722e
commit 215be64
Showing
8 changed files
with
967 additions
and
849 deletions.
There are no files selected for viewing
528 changes: 112 additions & 416 deletions
528
server/src/main/java/org/elasticsearch/gateway/GatewayMetaState.java
Large diffs are not rendered by default.
Oops, something went wrong.
384 changes: 384 additions & 0 deletions
384
server/src/main/java/org/elasticsearch/gateway/IncrementalClusterStateWriter.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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 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
Oops, something went wrong.