My Elasticsearch cluster is going to yellow state in about every 15 min, becuase 2 replica shards are going to initialization state. After 5 mins or so, cluster is going back to green state.
Error Logs:
[o.e.t.OutboundHandler ] [SDV200000A] failed to serialize outbound message [Request{indices:data/write/bulk[s][r]}{19424480}{false}{false}{false}]
java.lang.IllegalArgumentException: ReleasableBytesStreamOutput cannot hold more than 2GB of data.
I checked the code also given in the stack trace
Caused by: java.lang.IllegalArgumentException: ReleasableBytesStreamOutput cannot hold more than 2GB of data
at org.elasticsearch.common.io.stream.BytesStreamOutput.ensureCapacity(BytesStreamOutput.java:175)
ensureCapacity() is taking long argument and comparing its value with int_MAX32.
To my understanding it looks like it creates pages during serialization process and the total size of those create pages is going more than 2gbs.
Can you please share your thoughts around this and what could be the possible reasons for this issue?
And why its specifically happening for replica shards not for the primary one?