Skip to content

Commit

Permalink
Modify shrink exception to be more informative (#12117) (#12136)
Browse files Browse the repository at this point in the history
(cherry picked from commit f715ee1)

Signed-off-by: Poojita Raj <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 2011c13 commit a98f719
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 a98f719

Please sign in to comment.