Skip to content

Commit f715ee1

Browse files
authored
Modify shrink exception to be more informative (#12117)
Signed-off-by: Poojita Raj <poojiraj@amazon.com>
1 parent 3c07461 commit f715ee1

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationResizeRequestIT.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ public void testCreateShrinkIndexThrowsExceptionWhenReplicasBehind() throws Exce
8787
.get()
8888
);
8989
assertEquals(
90-
" For index [test] replica shards haven't caught up with primary, please retry after sometime.",
90+
"Replication still in progress for index [test]. Please wait for replication to complete and retry. "
91+
+ "Use the _cat/segment_replication/test api to check if the index is up to date (e.g. bytes_behind == 0).",
9192
exception.getMessage()
9293
);
9394

server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,11 @@ protected void clusterManagerOperation(
168168
.getSegments()
169169
.getReplicationStats().maxBytesBehind != 0) {
170170
throw new IllegalStateException(
171-
" For index ["
171+
"Replication still in progress for index ["
172172
+ sourceIndex
173-
+ "] replica shards haven't caught up with primary, please retry after sometime."
173+
+ "]. Please wait for replication to complete and retry. Use the _cat/segment_replication/"
174+
+ sourceIndex
175+
+ " api to check if the index is up to date (e.g. bytes_behind == 0)."
174176
);
175177
}
176178

0 commit comments

Comments
 (0)