fabriziofortino commented on code in PR #2950:
URL: https://github.com/apache/jackrabbit-oak/pull/2950#discussion_r3460725065
##########
oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/ElasticIndexStatistics.java:
##########
@@ -216,7 +231,15 @@ static class StatsCacheLoader implements
CacheLoader<StatsRequestDescriptor, Sta
@Override
public @NotNull StatsResponse load(@NotNull StatsRequestDescriptor
countRequestDescriptor) throws IOException {
- return stats(countRequestDescriptor);
+ try {
+ return stats(countRequestDescriptor);
+ } catch (ElasticsearchException ee) {
+ if (ee.status() == 404 && FT_OAK_12248_ENABLE.get()) {
+ LOG.debug("ES alias not found for index {} — returning
empty stats (OAK-12248)", countRequestDescriptor.index);
Review Comment:
same comment as above
##########
oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/ElasticIndexStatistics.java:
##########
@@ -195,7 +202,15 @@ static class CountCacheLoader implements
CacheLoader<StatsRequestDescriptor, Int
@Override
public @NotNull Integer load(@NotNull StatsRequestDescriptor
countRequestDescriptor) throws IOException {
- return count(countRequestDescriptor);
+ try {
+ return count(countRequestDescriptor);
+ } catch (ElasticsearchException ee) {
+ if (ee.status() == 404 && FT_OAK_12248_ENABLE.get()) {
+ LOG.debug("ES alias not found for index {} — treating as
empty (OAK-12248)", countRequestDescriptor.index);
Review Comment:
what about printing this at `INFO`? The value is actually cached so the
number of logs coming from here will be limited. We can then move it to `DEBUG`
if/when the toggle will be removed and this will be the default.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]