Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Optimized date histogram aggregations by preventing unnecessary object allocations in date rounding utils ([19088](https://github.com/opensearch-project/OpenSearch/pull/19088))
- Optimize source conversion in gRPC search hits using zero-copy BytesRef ([#19280](https://github.com/opensearch-project/OpenSearch/pull/19280))
- Add failureaccess as runtime dependency to transport-grpc module ([#19339](https://github.com/opensearch-project/OpenSearch/pull/19339))
- IllegalArgumentException when shrink operation performed on index without write block ([#19412](https://github.com/opensearch-project/OpenSearch/pull/19412))

### Fixed
- Fix unnecessary refreshes on update preparation failures ([#15261](https://github.com/opensearch-project/OpenSearch/issues/15261))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,20 @@ setup:
- match: { _id: "1" }
- match: { _source: { foo: "hello world" } }

- do:
catch: /action_request_validation_exception/
indices.shrink:
index: "source"
target: "new_shrunken_index"
wait_for_active_shards: 1
cluster_manager_timeout: 10s
body:
settings:
index.number_of_replicas: 0
index.number_of_shards: 1
index.blocks.read_only: true


# Related issue: https://github.com/opensearch-project/OpenSearch/issues/4845
---
"Returns error if target index's metadata write is blocked":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1652,7 +1652,7 @@ static IndexMetadata validateResize(ClusterState state, String sourceIndex, Stri

// ensure write operations on the source index is blocked
if (state.blocks().indexBlocked(ClusterBlockLevel.WRITE, sourceIndex) == false) {
throw new IllegalStateException(
throw new IllegalArgumentException(
"index " + sourceIndex + " must block write operations to resize index. use \"index.blocks.write=true\""
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ public void testValidateShrinkIndex() {
assertEquals(
"index source must block write operations to resize index. use \"index.blocks.write=true\"",
expectThrows(
IllegalStateException.class,
IllegalArgumentException.class,
() -> MetadataCreateIndexService.validateShrinkIndex(
createClusterState("source", randomIntBetween(2, 100), randomIntBetween(0, 10), Settings.EMPTY),
"source",
Expand Down Expand Up @@ -443,7 +443,7 @@ public void testValidateSplitIndex() {
assertEquals(
"index source must block write operations to resize index. use \"index.blocks.write=true\"",
expectThrows(
IllegalStateException.class,
IllegalArgumentException.class,
() -> MetadataCreateIndexService.validateSplitIndex(
createClusterState("source", randomIntBetween(2, 100), randomIntBetween(0, 10), Settings.EMPTY),
"source",
Expand Down Expand Up @@ -529,7 +529,7 @@ public void testValidateCloneIndex() {
assertEquals(
"index source must block write operations to resize index. use \"index.blocks.write=true\"",
expectThrows(
IllegalStateException.class,
IllegalArgumentException.class,
() -> MetadataCreateIndexService.validateCloneIndex(
createClusterState("source", randomIntBetween(2, 100), randomIntBetween(0, 10), Settings.EMPTY),
"source",
Expand Down
Loading