Skip to content

Commit 401172a

Browse files
committed
Only Apply restrictions to indexing requests
1 parent d0b52df commit 401172a

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

server/src/main/java/org/elasticsearch/action/bulk/TransportAbstractBulkAction.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -415,12 +415,7 @@ private void applyPipelinesAndDoInternalExecute(
415415
DocWriteRequest<?> req = bulkRequestModifier.bulkRequest.requests.get(i);
416416
String prefix = streamType.getStreamName() + ".";
417417

418-
boolean prePipeline = true;
419-
if (req instanceof IndexRequest ir) {
420-
prePipeline = ir.isPipelineResolved() == false;
421-
}
422-
423-
if (req != null && req.index() != null && req.index().startsWith(prefix) && prePipeline) {
418+
if (req instanceof IndexRequest ir && ir.index().startsWith(prefix) && ir.isPipelineResolved() == false) {
424419
IllegalArgumentException e = new IllegalArgumentException(
425420
"Direct writes to child streams are prohibited. Index directly into the ["
426421
+ streamType.getStreamName()

0 commit comments

Comments
 (0)