-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Add split recovery source #124834
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
Add split recovery source #124834
Changes from 26 commits
4ee90b9
0927aab
33d43a0
9c8ee34
b074858
2adadff
68a6ea3
eff3f69
f8c0ffd
739ee52
b3eb70e
19514be
e5300c0
f9ed927
96cec40
bba78b0
89f5b43
ea3b3c8
403f146
e72afa5
ecced4f
8103712
28353a4
2008217
9578b16
f157bfd
c68c056
e09baf4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,6 +57,7 @@ public static RecoverySource readFrom(StreamInput in) throws IOException { | |
| case PEER -> PeerRecoverySource.INSTANCE; | ||
| case SNAPSHOT -> new SnapshotRecoverySource(in); | ||
| case LOCAL_SHARDS -> LocalShardsRecoverySource.INSTANCE; | ||
| case SPLIT -> SplitRecoverySource.INSTANCE; | ||
|
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. Can we add this recovery type to the top of this class where the other ones are also listed. |
||
| }; | ||
| } | ||
|
|
||
|
|
@@ -78,7 +79,8 @@ public enum Type { | |
| EXISTING_STORE, | ||
| PEER, | ||
| SNAPSHOT, | ||
| LOCAL_SHARDS | ||
| LOCAL_SHARDS, | ||
| SPLIT | ||
| } | ||
|
|
||
| public abstract Type getType(); | ||
|
|
@@ -319,4 +321,36 @@ public boolean expectEmptyRetentionLeases() { | |
| return false; | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * peer recovery from a primary shard | ||
|
||
| */ | ||
| public static class SplitRecoverySource extends RecoverySource { | ||
|
|
||
| public static final SplitRecoverySource INSTANCE = new SplitRecoverySource(); | ||
|
|
||
| private SplitRecoverySource() {} | ||
|
|
||
| @Override | ||
| public Type getType() { | ||
| return Type.SPLIT; | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return "split recovery"; | ||
| } | ||
|
|
||
| @Override | ||
| protected void writeAdditionalFields(StreamOutput out) throws IOException { | ||
| super.writeAdditionalFields(out); | ||
| } | ||
|
|
||
| @Override | ||
| public void addAdditionalFields(XContentBuilder builder, Params params) throws IOException { | ||
| super.addAdditionalFields(builder, params); | ||
| } | ||
|
|
||
| // TODO: Expect empty retention leases? | ||
| } | ||
| } | ||
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.
nit, do we have a custom of
invalidfunctions that returnfalseif the state is valid? It seems like a double negative and usingvalidwould be more natural to me, unless that is against custom.