Fix handling of final pipelines when destination is changed#59522
Fix handling of final pipelines when destination is changed#59522probakowski merged 10 commits intoelastic:masterfrom
Conversation
|
Pinging @elastic/es-core-features (:Core/Features/Ingest) |
martijnvg
left a comment
There was a problem hiding this comment.
Thanks @probakowski! Left a few comments.
Also I don't think the following scenarios are tested:
- if request/default pipeline changes destination final pipeline from old index won't be executed
- if request/default pipeline changes destination and new index has final pipeline it will be executed default pipeline from new index won't be executed
So maybe add a test for that? I think a unit test is tricky, but an integration test should be possible.
server/src/main/java/org/elasticsearch/ingest/IngestService.java
Outdated
Show resolved
Hide resolved
| Iterator<String> newIt = it; | ||
| boolean newHasFinalPipeline = hasFinalPipeline; | ||
|
|
||
| if (oldIndex.equals(indexRequest.indices()[0]) == false && state != null) { |
There was a problem hiding this comment.
I think if state is null then an error should be returned? If a node has been started and is ready to accept requests then all components like IngestService should have been provided a cluster state.
There was a problem hiding this comment.
I removed the check, as you said state should be always filled, if not we have deeper problem here. WDYT?
There was a problem hiding this comment.
Yes, then there is a deeper problem elsewhere.
But that is not related to ingest or bulk.
server/src/main/java/org/elasticsearch/ingest/IngestService.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/ingest/IngestService.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/ingest/IngestService.java
Outdated
Show resolved
Hide resolved
|
Thanks for review @martijnvg! |
|
@elasticmachine update branch |
…59522) This change fixes final pipelines if destination index is changed during pipeline run: -final pipelines can't change destination anymore, exception is thrown if they try to -if request/default pipeline changes destination final pipeline from old index won't be executed -if request/default pipeline changes destination and new index has final pipeline it will be executed -default pipeline from new index won't be executed Additionally TransportBulkAction.resolvePipelines was moved to IngestService as it's needed for resolving pipelines from new index. Tests were moved accordingly. Closes elastic#57968
…9522) (#59746) * Fix handling of final pipelines when destination is changed (#59522) This change fixes final pipelines if destination index is changed during pipeline run: -final pipelines can't change destination anymore, exception is thrown if they try to -if request/default pipeline changes destination final pipeline from old index won't be executed -if request/default pipeline changes destination and new index has final pipeline it will be executed -default pipeline from new index won't be executed Additionally TransportBulkAction.resolvePipelines was moved to IngestService as it's needed for resolving pipelines from new index. Tests were moved accordingly. Closes #57968
…astic#59522) (elastic#59746) * Fix handling of final pipelines when destination is changed (elastic#59522) This change fixes final pipelines if destination index is changed during pipeline run: -final pipelines can't change destination anymore, exception is thrown if they try to -if request/default pipeline changes destination final pipeline from old index won't be executed -if request/default pipeline changes destination and new index has final pipeline it will be executed -default pipeline from new index won't be executed Additionally TransportBulkAction.resolvePipelines was moved to IngestService as it's needed for resolving pipelines from new index. Tests were moved accordingly. Closes elastic#57968
…9522) (#59756) * Fix handling of final pipelines when destination is changed (#59522) This change fixes final pipelines if destination index is changed during pipeline run: -final pipelines can't change destination anymore, exception is thrown if they try to -if request/default pipeline changes destination final pipeline from old index won't be executed -if request/default pipeline changes destination and new index has final pipeline it will be executed -default pipeline from new index won't be executed Additionally TransportBulkAction.resolvePipelines was moved to IngestService as it's needed for resolving pipelines from new index. Tests were moved accordingly. Closes #57968
This has broken all of my ingest pipelines, but is not called out as a breaking change. |
This change fixes final pipelines if destination index is changed during pipeline run:
Additionally
TransportBulkAction.resolvePipelineswas moved toIngestServiceas it's needed for resolving pipelines from new index. Tests were moved accordingly.Closes #57968