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

Cleanup Unreferenced file on segment merge failure #9503

Merged
merged 1 commit into from
Sep 6, 2023

Conversation

RS146BIJAY
Copy link
Contributor

Description

Currently, during segment merge (both during auto merge and force merge), OpenSearch creates multiple temporary files while merging individual segment components. Once individual components of the segments are merged, IndexWriter creates a Compound file (*.cfs) containing all the Lucene components for a segment. At the end, OpenSearch deletes these temporary files.

Now, in case these temporary files consume all the space on the node (because enough amount of space is unavailable for segment merge to go through), segment merge will fail. Also, the files which got created during segment merge do not get cleaned up and it continues to occupy space on the node. This can cause FSHealthService checks to fail for this node, ultimately causing these nodes to be removed from cluster.

Expected behavior
In case Force segment merge fails, OpenSearch should remove the temporary files created during segment merge.

Related Issues

Resolves #[Issue number to be closed when this PR is merged]
#5710
#8024

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.

@opensearch-trigger-bot
Copy link
Contributor

Compatibility status:

Checks if related components are compatible with change 5d3633c

Incompatible components

Incompatible components: [https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/security-analytics.git]

Skipped components

Compatible components

Compatible components: [https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git]

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@RS146BIJAY RS146BIJAY force-pushed the segment-merge-failures branch 3 times, most recently from f447ed8 to db13f01 Compare August 23, 2023 15:06
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@codecov
Copy link

codecov bot commented Aug 23, 2023

Codecov Report

Merging #9503 (1a53e6a) into main (19a13f0) will decrease coverage by 0.09%.
Report is 4 commits behind head on main.
The diff coverage is 77.85%.

@@             Coverage Diff              @@
##               main    #9503      +/-   ##
============================================
- Coverage     71.14%   71.06%   -0.09%     
- Complexity    57973    57982       +9     
============================================
  Files          4825     4827       +2     
  Lines        273348   273560     +212     
  Branches      39841    39860      +19     
============================================
- Hits         194473   194401      -72     
- Misses        62523    62779     +256     
- Partials      16352    16380      +28     
Files Changed Coverage Δ
...on/admin/indices/shrink/TransportResizeAction.java 49.24% <0.00%> (-18.47%) ⬇️
...pensearch/common/settings/IndexScopedSettings.java 100.00% <ø> (ø)
...ofile/aggregation/AggregationProfileBreakdown.java 0.00% <ø> (ø)
...rch/search/profile/ContextualProfileBreakdown.java 75.00% <50.00%> (-25.00%) ⬇️
...search/profile/query/AbstractQueryProfileTree.java 76.92% <76.92%> (ø)
.../main/java/org/opensearch/index/engine/Engine.java 74.38% <86.66%> (-0.35%) ⬇️
...arch/profile/query/ConcurrentQueryProfileTree.java 88.88% <88.88%> (ø)
...profile/query/ConcurrentQueryProfileBreakdown.java 98.59% <98.51%> (-1.41%) ⬇️
...in/cluster/remotestore/stats/RemoteStoreStats.java 96.24% <100.00%> (ø)
.../main/java/org/opensearch/index/IndexSettings.java 86.35% <100.00%> (+0.20%) ⬆️
... and 8 more

... and 467 files with indirect coverage changes

@opensearch-trigger-bot
Copy link
Contributor

Compatibility status:

Checks if related components are compatible with change 980bf3c

Incompatible components

Incompatible components: [https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/security-analytics.git]

Skipped components

Compatible components

Compatible components: [https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git]

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@RS146BIJAY
Copy link
Contributor Author

Gradle failure seems related to this: #9688

@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2023

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2023

Compatibility status:

Checks if related components are compatible with change b7e61bd

Incompatible components

Incompatible components: [https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/anomaly-detection.git]

Skipped components

Compatible components

Compatible components: [https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/reporting.git]

@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2023

Compatibility status:

Checks if related components are compatible with change 82baab7

Incompatible components

Incompatible components: [https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/neural-search.git]

Skipped components

Compatible components

Compatible components: [https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git]

@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2023

Gradle Check (Jenkins) Run Completed with:

Signed-off-by: Rishav Sagar <rissag@amazon.com>
@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2023

Compatibility status:

Checks if related components are compatible with change 1a53e6a

Incompatible components

Incompatible components: [https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/neural-search.git]

Skipped components

Compatible components

Compatible components: [https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git]

@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2023

Gradle Check (Jenkins) Run Completed with:

@gbbafna gbbafna merged commit 37bdb6b into opensearch-project:main Sep 6, 2023
12 checks passed
@gbbafna gbbafna added the backport 2.x Backport to 2.x branch label Sep 6, 2023
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch/backport-2.x
# Create a new branch
git switch --create backport/backport-9503-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 37bdb6bb6536b31392f1dcfaa0eb0f0ab283c2c9
# Push it to GitHub
git push --set-upstream origin backport/backport-9503-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-9503-to-2.x.

RS146BIJAY added a commit to RS146BIJAY/OpenSearch that referenced this pull request Sep 6, 2023
…t#9503)

Signed-off-by: Rishav Sagar <rissag@amazon.com>
(cherry picked from commit 37bdb6b)
RS146BIJAY added a commit to RS146BIJAY/OpenSearch that referenced this pull request Sep 6, 2023
…t#9503)

Signed-off-by: Rishav Sagar <rissag@amazon.com>
(cherry picked from commit 37bdb6b)
RS146BIJAY added a commit to RS146BIJAY/OpenSearch that referenced this pull request Sep 6, 2023
…t#9503)

Signed-off-by: Rishav Sagar <rissag@amazon.com>
(cherry picked from commit 37bdb6b)
RS146BIJAY added a commit to RS146BIJAY/OpenSearch that referenced this pull request Sep 6, 2023
…t#9503)

Signed-off-by: Rishav Sagar <rissag@amazon.com>
(cherry picked from commit 37bdb6b)
RS146BIJAY added a commit to RS146BIJAY/OpenSearch that referenced this pull request Sep 6, 2023
…t#9503)

Signed-off-by: Rishav Sagar <rissag@amazon.com>
(cherry picked from commit 37bdb6b)
Signed-off-by: Rishav Sagar <rissag@amazon.com>
RS146BIJAY added a commit to RS146BIJAY/OpenSearch that referenced this pull request Sep 6, 2023
…t#9503)

Signed-off-by: Rishav Sagar <rissag@amazon.com>
(cherry picked from commit 37bdb6b)
Signed-off-by: Rishav Sagar <rissag@amazon.com>
RS146BIJAY added a commit to RS146BIJAY/OpenSearch that referenced this pull request Sep 6, 2023
…t#9503)

Signed-off-by: Rishav Sagar <rissag@amazon.com>
(cherry picked from commit 37bdb6b)
Signed-off-by: Rishav Sagar <rissag@amazon.com>
gbbafna pushed a commit that referenced this pull request Sep 6, 2023
(cherry picked from commit 37bdb6b)

Signed-off-by: Rishav Sagar <rissag@amazon.com>
kaushalmahi12 pushed a commit to kaushalmahi12/OpenSearch that referenced this pull request Sep 12, 2023
…t#9503)

Signed-off-by: Rishav Sagar <rissag@amazon.com>
Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>
brusic pushed a commit to brusic/OpenSearch that referenced this pull request Sep 25, 2023
…t#9503)

Signed-off-by: Rishav Sagar <rissag@amazon.com>
Signed-off-by: Ivan Brusic <ivan.brusic@flocksafety.com>
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
…t#9503)

Signed-off-by: Rishav Sagar <rissag@amazon.com>
Signed-off-by: Shivansh Arora <hishiv@amazon.com>
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 backport-failed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants