-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Delete Operations on Replicas when Segment Replication is enabled #2839
Delete Operations on Replicas when Segment Replication is enabled #2839
Conversation
Signed-off-by: Rishikesh1159 <[email protected]>
Signed-off-by: Rishikesh1159 <[email protected]>
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.
LGTM few nits.
|
||
createIndex( | ||
INDEX_NAME, | ||
Settings.builder() |
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.
Sorry I missed this on the last PR. You shouldn't need to set these settings here because we override the indexSettings() method at the top of this file.
createIndex(INDEX_NAME);
Will create the index with the default settings we override.
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.
Yeah sorry I too missed it
@@ -716,11 +717,13 @@ private ExternalReaderManager createReaderManager(RefreshWarmerListener external | |||
} | |||
|
|||
private DirectoryReader getDirectoryReader() throws IOException { | |||
// for segment replication: replicas should create the reader from store, we don't want an open IW on replicas. | |||
// for segment replication: replicas should create the reader from store and, we don't want an open IW on replicas. | |||
/* We should always wrap replicas with a SoftDeletesDirectoryReaderWrapper as we use soft deletes when segment replication is on for |
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 - "We should always wrap the DirectoryReader used on replicas with SoftDeletesDirectoryReaderWrapper
so that we filter out soft deletes.
} | ||
return DirectoryReader.open(indexWriter); | ||
return DirectoryReader.open(indexWriter, true, true); |
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.
is this required? does your test pass without this like with the first PR?
I forgot this also impacts the reader with segrep off - if this isn't required with segrep on then we should remove it. Otherwise it needs to be gated by reading the setting. It is changing how the primary behaves with segrep off.
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.
This isn't required with segrep on. I think we remove it
Signed-off-by: Rishikesh1159 <[email protected]>
Signed-off-by: Rishikesh1159 <[email protected]>
…ature/segment-replication
Signed-off-by: Rishikesh1159 <[email protected]>
Signed-off-by: Rishikesh Pasham <[email protected]>
Signed-off-by: Rishikesh Pasham <[email protected]>
61ecbc8
into
opensearch-project:feature/segment-replication
Description
This PR fixes delete operations to only write to xlog on replicas. Integration Test for this is also added
Issues Resolved
#2330
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.