Skip to content

Conversation

@monusingh-1
Copy link

@monusingh-1 monusingh-1 commented Sep 25, 2025

Description

This change changes the Exception thrown when shrink operation is performed on an index which does not have write block from IllegalStateException(5xx) to IllegalArgumentException(4xx)

Related Issues

Resolves #19026

Testing

curl -X POST "localhost:9200/test-01/_shrink/test-shrink-01" -H 'Content-Type: application/json' -d'              15:57:01
{
  "settings": {
    "index.number_of_shards": 1,
    "index.number_of_replicas": 0
  }
}'

Before

{"error":{"root_cause":[{"type":"illegal_state_exception","reason":"index test-01 must block write operations to resize index. use "index.blocks.write=true""}],"type":"illegal_state_exception","reason":"index test-01 must block write operations to resize index. use "index.blocks.write=true""},"status":500}

After

{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"index test-01 must block write operations to resize index. use "index.blocks.write=true""}],"type":"illegal_argument_exception","reason":"index test-01 must block write operations to resize index. use "index.blocks.write=true""},"status":400}%

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

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.

@github-actions
Copy link
Contributor

✅ Gradle check result for 2f29436: SUCCESS

@codecov
Copy link

codecov bot commented Sep 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.97%. Comparing base (e5d01b5) to head (7a7a40a).

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #19415      +/-   ##
============================================
- Coverage     73.03%   72.97%   -0.07%     
+ Complexity    69997    69900      -97     
============================================
  Files          5676     5676              
  Lines        320923   320923              
  Branches      46392    46392              
============================================
- Hits         234396   234183     -213     
- Misses        67610    67737     +127     
- Partials      18917    19003      +86     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@monusingh-1 monusingh-1 marked this pull request as ready for review September 25, 2025 12:31
@monusingh-1 monusingh-1 requested a review from a team as a code owner September 25, 2025 12:31
@github-actions github-actions bot added bug Something isn't working Cluster Manager good first issue Good for newcomers labels Sep 25, 2025
@github-actions
Copy link
Contributor

✅ Gradle check result for 7a7a40a: SUCCESS

@github-actions
Copy link
Contributor

❌ Gradle check result for 6dd01b5: null

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@opensearch-trigger-bot
Copy link
Contributor

This PR is stalled because it has been open for 30 days with no activity.

@opensearch-trigger-bot opensearch-trigger-bot bot added the stalled Issues that have stalled label Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Cluster Manager good first issue Good for newcomers stalled Issues that have stalled

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[BUG] Resize request should throw 4xx as part of validation failure for write block

1 participant