-
Notifications
You must be signed in to change notification settings - Fork 1.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
Add support for restoring from snapshot with search replicas #16111
base: main
Are you sure you want to change the base?
Add support for restoring from snapshot with search replicas #16111
Conversation
❌ Gradle check result for 7556720: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
@@ -650,6 +661,23 @@ public ClusterState execute(ClusterState currentState) { | |||
return allocationService.reroute(updatedState, "restored snapshot [" + snapshot + "]"); | |||
} | |||
|
|||
private void validateReplicationTypeRestoreSettings(String snapshotReplicationType, |
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.
nitpicks -
Lets pass a ReplicationType here and parse in the caller and use ReplicationType. DOCUMENT.equals(replicationType)
is snapshotIndexMetadata
the metadata inside the snapshot? Passing that as restoreReplicationType
is a bit confusing. How about snapshottedMetadata
and updatedMetadata
?
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.
snapshotIndexMetadata
contains metadata of snapshot and whatever setting user is trying to override. So basically its a metadata which will be applied for resulting restored index.
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.
do you mean like this?
private void validateReplicationTypeRestoreSettings(IndexMetadata snapshottedMetadata, IndexMetadata updatedMetadata)
server/src/test/java/org/opensearch/cluster/routing/SearchOnlyReplicaRestoreTests.java
Outdated
Show resolved
Hide resolved
.../src/internalClusterTest/java/org/opensearch/indices/replication/SearchReplicaRestoreIT.java
Outdated
Show resolved
Hide resolved
.../src/internalClusterTest/java/org/opensearch/indices/replication/SearchReplicaRestoreIT.java
Outdated
Show resolved
Hide resolved
.../src/internalClusterTest/java/org/opensearch/indices/replication/SearchReplicaRestoreIT.java
Outdated
Show resolved
Hide resolved
.../src/internalClusterTest/java/org/opensearch/indices/replication/SearchReplicaRestoreIT.java
Outdated
Show resolved
Hide resolved
.../src/internalClusterTest/java/org/opensearch/indices/replication/SearchReplicaRestoreIT.java
Outdated
Show resolved
Hide resolved
.../src/internalClusterTest/java/org/opensearch/indices/replication/SearchReplicaRestoreIT.java
Outdated
Show resolved
Hide resolved
❌ Gradle check result for 7f03249: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for a84f849: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for a84f849: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
a84f849
to
53821df
Compare
❌ Gradle check result for 53821df: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
53821df
to
ebccad3
Compare
❌ Gradle check result for ebccad3: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
aae9ca6
to
b757f29
Compare
❌ Gradle check result for b757f29: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for 7f79749: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Vinay Krishna Pudyodu <[email protected]>
Signed-off-by: Vinay Krishna Pudyodu <[email protected]>
Signed-off-by: Vinay Krishna Pudyodu <[email protected]>
Signed-off-by: Vinay Krishna Pudyodu <[email protected]>
Signed-off-by: Vinay Krishna Pudyodu <[email protected]>
7f79749
to
641a804
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #16111 +/- ##
============================================
- Coverage 71.88% 71.84% -0.05%
+ Complexity 64496 64475 -21
============================================
Files 5291 5291
Lines 301668 301679 +11
Branches 43576 43579 +3
============================================
- Hits 216863 216747 -116
- Misses 67031 67123 +92
- Partials 17774 17809 +35 ☔ View full report in Codecov by Sentry. |
Description
In this PR we are adding,
DOCUMENT
andSEGMENT
replication type while snapshot restoration. Following are the allowed rules:DOCUMENT
can be restored toDOCUMENT
orSEGMENT
types. If we are restoring toSEGMENT
type more search replicas can be added.SEGMENT
and without any search replicas can be restored toDOCUMENT
orSEGMENT
types. If we are restoring toSEGMENT
type more search replicas can be added.SEGMENT
and with search replicas can be restored toDOCUMENT
orSEGMENT
types. If we are restoring toSEGMENT
type more search replicas can be added. If we are restoring toDOCUMENT
type search replica count must be set to 0 in the settings.Related Issues
Resolves #15532
Related #15306
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.