-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Add support for Warm Indices Write Block on Flood Watermark breach #18375
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
Merged
gbbafna
merged 16 commits into
opensearch-project:main
from
Gagan6164:AddWarmDiskMonitor
Jun 18, 2025
Merged
Changes from 12 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
d73241f
Support Warm Index Write Block on flood Watermark breach
1f98e95
Refactoring Disk Threshold Evaluation for hot and warm nodes
3c9e688
Merge branch 'main' into AddWarmDiskMonitor
341e34a
Add unit tests for warm node disk threshold monitor
e7d8710
Add IT test for warm node disk threshold monitor
ccab093
Merge branch 'main' into AddWarmDiskMonitor
Gagan6164 3570c0d
gradlew spotless fix
e1a7fa6
Resolve comments
4209aab
small change
bdd3945
Add Changelog
6e7922c
Spotless fix
f588845
Merge branch 'main' into AddWarmDiskMonitor
326f1ea
Resolving comments
d42ea62
Handle 0 total addressable space value
c8b17e2
Merge branch 'main' into AddWarmDiskMonitor
Gagan6164 5668c5c
Update CHANGELOG.md
Gagan6164 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
303 changes: 215 additions & 88 deletions
303
...erTest/java/org/opensearch/cluster/routing/allocation/decider/DiskThresholdDeciderIT.java
Large diffs are not rendered by default.
Oops, something went wrong.
69 changes: 69 additions & 0 deletions
69
server/src/main/java/org/opensearch/cluster/routing/allocation/DiskThresholdEvaluator.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| /* | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| * | ||
| * The OpenSearch Contributors require contributions made to | ||
| * this file be licensed under the Apache-2.0 license or a | ||
| * compatible open source license. | ||
| */ | ||
|
|
||
| package org.opensearch.cluster.routing.allocation; | ||
|
|
||
| import org.opensearch.cluster.DiskUsage; | ||
|
|
||
| /** | ||
| * Base interface for disk threshold evaluation logic. | ||
| * This interface defines methods for evaluating whether a node exceeds | ||
| * various watermarks based on disk usage. | ||
| * | ||
| * @opensearch.internal | ||
| */ | ||
| public interface DiskThresholdEvaluator { | ||
|
|
||
| /** | ||
| * Checks if a node is exceeding the low watermark threshold | ||
| * | ||
| * @param diskUsage disk usage for the node | ||
| * @return true if the node is exceeding the low watermark, false otherwise | ||
| */ | ||
| boolean isNodeExceedingLowWatermark(DiskUsage diskUsage); | ||
|
|
||
| /** | ||
| * Checks if a node is exceeding the high watermark threshold | ||
| * | ||
| * @param diskUsage disk usage for the node | ||
| * @return true if the node is exceeding the high watermark, false otherwise | ||
| */ | ||
| boolean isNodeExceedingHighWatermark(DiskUsage diskUsage); | ||
|
|
||
| /** | ||
| * Checks if a node is exceeding the flood stage watermark threshold | ||
| * | ||
| * @param diskUsage disk usage for the node | ||
| * @return true if the node is exceeding the flood stage watermark, false otherwise | ||
| */ | ||
| boolean isNodeExceedingFloodStageWatermark(DiskUsage diskUsage); | ||
Gagan6164 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| /** | ||
| * Get the free space low threshold for a given total space | ||
| * | ||
| * @param totalSpace total available space | ||
| * @return free space low threshold in bytes | ||
| */ | ||
| long getFreeSpaceLowThreshold(long totalSpace); | ||
|
|
||
| /** | ||
| * Get the free space high threshold for a given total space | ||
| * | ||
| * @param totalSpace total available space | ||
| * @return free space high threshold in bytes | ||
| */ | ||
| long getFreeSpaceHighThreshold(long totalSpace); | ||
|
|
||
| /** | ||
| * Get the free space flood stage threshold for a given total space | ||
| * | ||
| * @param totalSpace total available space | ||
| * @return free space flood stage threshold in bytes | ||
| */ | ||
| long getFreeSpaceFloodStageThreshold(long totalSpace); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.