Closed
Description
It cost us 1 month to troubleshoot the issue of high indexing latency(p95 10s+) during high traffic with customized routing.
Finally we find that RefreshPolicy
is set to IMMEDIATE
by default, and latency becomes normal after we manually set it to None
.
According to the official document, the default refresh behavior should be set to false
unless you're really care about "data consistency". And only Reactive Template
has such default value, all others are null
.
In order to help save efforts for all users in future, I'd suggest change below two default values to NONE
(Not sure if there's any more places):
- https://github.com/spring-projects/spring-data-elasticsearch/blob/main/src/main/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchTemplate.java#L123
- https://github.com/spring-projects/spring-boot/blob/main/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchDataConfiguration.java#L111