existsAlias returns false

Hi,

Using RestHighLevelClient with Elasticsearch 7.17.7 both client and server.
For new records coming in I check wether an expected alias exists.

boolean exists = client.indices().existsAlias(requestWithAlias, RequestOptions.DEFAULT);

At times I can see this API return false for an alias that was created long ago. This can even happen with 2 almost consecutive calls with just a second or so in between.

An example from my own logs (truncated logs):

7:30:59.141 AM alias exists
7:31:01.279 AM alias does not exist

According to the documentation:

In cases where the server returns a 4xx or 5xx error code, the high-level client tries to parse the response body error details instead and then throws a generic ElasticsearchException and adds the original ResponseException as a suppressed exception to it.

But because there was no exception, I assume that some code other than 200 was returned (looking into the Java code, 200 will return true otherwise false - so I guess a 404 was returned but I don't know for sure).

I was thinking perhaps there was a timeout, but shouldn't this have resulted in an exception?

I can also see some logs from ES mentioning memory from time to time (not necessarily adjacent to the example above):

attempting to trigger G1GC due to high heap usage

followed by:

GC did bring memory usage down

Any idea why existsAlias sometimes returns false for an alias that exists for sure?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.