From 7862cd1a82c62f34e27c326a7b0adc2cd9b96399 Mon Sep 17 00:00:00 2001 From: carlosdelest Date: Thu, 26 Oct 2023 16:36:22 +0200 Subject: [PATCH] Add assertion for making sure inference runs last --- .../org/elasticsearch/action/bulk/TransportBulkAction.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/src/main/java/org/elasticsearch/action/bulk/TransportBulkAction.java b/server/src/main/java/org/elasticsearch/action/bulk/TransportBulkAction.java index dce0a3325bce1..7dd3c3b324562 100644 --- a/server/src/main/java/org/elasticsearch/action/bulk/TransportBulkAction.java +++ b/server/src/main/java/org/elasticsearch/action/bulk/TransportBulkAction.java @@ -159,6 +159,9 @@ public TransportBulkAction( this.indexingPressure = indexingPressure; this.systemIndices = systemIndices; clusterService.addStateApplier(this.ingestForwarder); + + assert bulkRequestPreprocessors.get(bulkRequestPreprocessors.size() - 1) instanceof FieldInferenceBulkRequestPreprocessor + : "Last bulk request processor should be the inference processor"; } /**