Skip to content
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

Prevent files still referenced by the on disk segments_N from deletion. #2336

Closed

Conversation

mch2
Copy link
Member

@mch2 mch2 commented Mar 4, 2022

Signed-off-by: Marc Handalian [email protected]

Description

This change updates the cleanup and validation steps after a replication event occurs to prevent
deleting files still referenced by both the on disk segments_N file and the in memory SegmentInfos.
After cleaning it validates the latest in memory SegmentInfos against the metadata sent from the primary shard.

This change also updates the sequence of steps in ReplicationTarget to first recreate the primary's SegmentInfos object so that we can perform validation before updating our reader. This also ensures our test will fail if the index is corrupt. Without this the test logs errors but passes because reader has already been updated with the latest docs and the shard is not removed - #2332.

Issues Resolved

closes #2331

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff

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.

This change updates the cleanup and validation steps after a replication event occurs to prevent
deleting files still referenced by both the on disk segments_N file and the in memory SegmentInfos.
After cleaning it validates the altest in memory SegmentInfos against the metadata sent from the primary shard.

Signed-off-by: Marc Handalian <[email protected]>
@mch2 mch2 requested a review from a team as a code owner March 4, 2022 03:05
@mch2 mch2 requested review from Poojita-Raj and kartg March 4, 2022 03:05
@opensearch-ci-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure 973ae50
Log 3010

Reports 3010

@mch2 mch2 closed this Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants