Skip to content

Commit

Permalink
Modify shrink exception to be more informative (#12117)
Browse files Browse the repository at this point in the history
Signed-off-by: Poojita Raj <[email protected]>
  • Loading branch information
Poojita-Raj authored Feb 1, 2024
1 parent 3c07461 commit f715ee1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ public void testCreateShrinkIndexThrowsExceptionWhenReplicasBehind() throws Exce
.get()
);
assertEquals(
" For index [test] replica shards haven't caught up with primary, please retry after sometime.",
"Replication still in progress for index [test]. Please wait for replication to complete and retry. "
+ "Use the _cat/segment_replication/test api to check if the index is up to date (e.g. bytes_behind == 0).",
exception.getMessage()
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,11 @@ protected void clusterManagerOperation(
.getSegments()
.getReplicationStats().maxBytesBehind != 0) {
throw new IllegalStateException(
" For index ["
"Replication still in progress for index ["
+ sourceIndex
+ "] replica shards haven't caught up with primary, please retry after sometime."
+ "]. Please wait for replication to complete and retry. Use the _cat/segment_replication/"
+ sourceIndex
+ " api to check if the index is up to date (e.g. bytes_behind == 0)."
);
}

Expand Down

0 comments on commit f715ee1

Please sign in to comment.