Follow up from #43194
Steps to reproduce:
- Create a dataset
- Create data frame transform
- Create destination index with conflicting mappings
- Start data frame transform
- Notice that it finishes without reporting any indexing failures in the
_stats API, even though ES logs show 100% of the docs have failed to index.
Bug:
There are 2 issues:
- the indexer does not fail
- the error count is wrong (we should count the bulk index failure as a whole, not the individual index failures)
Solution:
The error handling should use the same error handler that we use for search failures, meaning it should classify the issue into:
- temporary failures (e.g. individual shard failures due to trouble on the node holding the shard)
- irrecoverable failures (e.g. mapping conflict)
Temporary failures shall be retried, irrecoverable failures will set the state to failed without retry.
Retry will re-create/re-index the full page as a whole but not the individual index requests (which would be very complex).
/cc @dolaru @sophiec20
Closes #43194