Repository navigation
Description
When a shard bulk experiences a shard-level failure, we add the same exception instance to all its items:
elasticsearch/server/src/main/java/org/elasticsearch/action/bulk/BulkOperation.java
Lines 560 to 568 in 45f6a06
| private void handleShardFailure(BulkShardRequest bulkShardRequest, ProjectMetadata projectMetadata, Exception e) { | |
| // create failures for all relevant requests | |
| for (BulkItemRequest request : bulkShardRequest.items()) { | |
| final String indexName = request.index(); | |
| DocWriteRequest<?> docWriteRequest = request.request(); | |
| IndexDocFailureStoreStatus failureStoreStatus = processFailure(request, projectMetadata, e); | |
| addFailure(docWriteRequest, request.id(), indexName, e, failureStoreStatus); | |
| } | |
| } |
There's no way to capture this cross-item sharing in the transport protocol today, so instead we end up transporting N copies of the same exception over the wire (e.g. from an ingest node back to a coordinating node). Exceptions can be ~10kiB or more in size, and shard bulks can include many thousands of items, so this can end up producing pretty enormous transport messages.
Relates #157859 which describes a much worse situation in which these message sizes become quadratic in the number of items. But I still think we should consider finding a way to capture shared exceptions more efficiently than what we do today.
Activity
elasticsearchmachine commentedon Aug 27, 2026
Pinging @elastic/es-distributed (Team:Distributed)