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

Purge remote translog basis the latest metadata for remote-backed indexes #6086

Merged
merged 16 commits into from
Feb 3, 2023

Conversation

ashking94
Copy link
Member

@ashking94 ashking94 commented Jan 30, 2023

Description

During failover or relocation of primary shard, during initialisation of RemoteFsTranslog, we read remote translog metadata and download translog and checkpoint file for the corresponding primary term and generation as present in remote translog metadata file. After a flush, we clear *.tlog and *.ckp files, but the remote metadata file continues to hold references to the deleted generations. We need to handle the same.

We should delete remote translog considering the latest metadata file uploaded. The tlog/ckp files referenced by that metadata file should not be deleted . By doing this we will be able to restore translog from that metadata.

Issues Resolved

#5845

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
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)

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.

@ashking94 ashking94 added Storage:Durability Issues and PRs related to the durability framework skip-changelog v2.6.0 'Issues and PRs related to version v2.6.0' labels Jan 30, 2023
@ashking94 ashking94 marked this pull request as ready for review January 30, 2023 17:46
@ashking94 ashking94 changed the title Purge translog basis the latest metadata for remote-backed indexes Purge remote translog basis the latest metadata for remote-backed indexes Jan 30, 2023
Signed-off-by: Ashish Singh <ssashish@amazon.com>
Signed-off-by: Ashish Singh <ssashish@amazon.com>
Signed-off-by: Ashish Singh <ssashish@amazon.com>
@github-actions
Copy link
Contributor

github-actions bot commented Feb 1, 2023

Gradle Check (Jenkins) Run Completed with:

Signed-off-by: Ashish Singh <ssashish@amazon.com>
@github-actions
Copy link
Contributor

github-actions bot commented Feb 1, 2023

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.cluster.routing.allocation.decider.DiskThresholdDeciderIT.testIndexCreateBlockIsRemovedWhenAnyNodesNotExceedHighWatermark

Signed-off-by: Ashish Singh <ssashish@amazon.com>
Signed-off-by: Ashish Singh <ssashish@amazon.com>
@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2023

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2023

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2023

Gradle Check (Jenkins) Run Completed with:

Signed-off-by: Ashish Singh <ssashish@amazon.com>
@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2023

Gradle Check (Jenkins) Run Completed with:

@gbbafna
Copy link
Collaborator

gbbafna commented Feb 2, 2023

Build failed due to

> Task :modules:ingest-common:jarHell FAILED
| Output for C:\hostedtoolcache\windows\Java_Adopt_jdk\11.0.18-10\x64\bin\java.exe:#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 57616 bytes for Chunk::new
# An error report file with more information is saved as:
# D:\a\OpenSearch\OpenSearch\modules\ingest-common\hs_err_pid6884.log

Signed-off-by: Ashish Singh <ssashish@amazon.com>
@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2023

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.cluster.allocation.AwarenessAllocationIT.testThreeZoneOneReplicaWithForceZoneValueAndLoadAwareness

@ashking94
Copy link
Member Author

Build succeeded. @gbbafna

@gbbafna gbbafna merged commit 54ce423 into opensearch-project:main Feb 3, 2023
@gbbafna gbbafna added the backport 2.x Backport to 2.x branch label Feb 3, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request Feb 3, 2023
…exes (#6086)

* Deleting remote translog considering latest remote metadata

Co-authored-by: Gaurav Bafna <gbbafna@amazon.com>
Signed-off-by: Ashish Singh <ssashish@amazon.com>
(cherry picked from commit 54ce423)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
ashking94 pushed a commit to ashking94/OpenSearch that referenced this pull request Feb 6, 2023
…exes (opensearch-project#6086)

* Deleting remote translog considering latest remote metadata

Co-authored-by: Gaurav Bafna <gbbafna@amazon.com>
Signed-off-by: Ashish Singh <ssashish@amazon.com>
(cherry picked from commit 54ce423)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
gbbafna pushed a commit that referenced this pull request Feb 6, 2023
…exes (#6170)

* Purge remote translog basis the latest metadata for remote-backed indexes (#6086)

Co-authored-by: Gaurav Bafna <gbbafna@amazon.com>
Signed-off-by: Ashish Singh <ssashish@amazon.com>
(cherry picked from commit 54ce423)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch skip-changelog Storage:Durability Issues and PRs related to the durability framework v2.6.0 'Issues and PRs related to version v2.6.0'
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants