Skip to content

Commit

Permalink
logging(elasticsearch): improve messaging in orphan index detection (d…
Browse files Browse the repository at this point in the history
  • Loading branch information
david-leifker authored and Oleg Ruban committed Feb 28, 2023
1 parent 19f93be commit aa81ae2
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,11 @@ private static List<String> getOrphanedIndices(RestHighLevelClient searchClient,
}
}
} catch (Exception e) {
log.info("Failed to get orphaned indices with pattern {}: Exception {}", indexState.indexCleanPattern(), e.toString());
if (e.getMessage().contains("index_not_found_exception")) {
log.info("No orphaned indices found with pattern {}", indexState.indexCleanPattern());
} else {
log.error("An error occurred when trying to identify orphaned indices. Exception: {}", e.getMessage());
}
}
return orphanedIndices;
}
Expand Down

0 comments on commit aa81ae2

Please sign in to comment.