Skip to content

Fix handling of final pipelines when destination is changed#59522

Merged
probakowski merged 10 commits intoelastic:masterfrom
probakowski:final-pipeline
Jul 16, 2020
Merged

Fix handling of final pipelines when destination is changed#59522
probakowski merged 10 commits intoelastic:masterfrom
probakowski:final-pipeline

Conversation

@probakowski
Copy link
Copy Markdown
Contributor

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

@probakowski probakowski added >bug :Distributed/Ingest Node Execution or management of Ingest Pipelines v8.0.0 v7.9.0 labels Jul 14, 2020
@probakowski probakowski requested review from dakrone and martijnvg July 14, 2020 11:52
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-core-features (:Core/Features/Ingest)

@elasticmachine elasticmachine added the Team:Data Management (obsolete) DO NOT USE. This team no longer exists. label Jul 14, 2020
Copy link
Copy Markdown
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Iterator<String> newIt = it;
boolean newHasFinalPipeline = hasFinalPipeline;

if (oldIndex.equals(indexRequest.indices()[0]) == false && state != null) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the check, as you said state should be always filled, if not we have deeper problem here. WDYT?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, then there is a deeper problem elsewhere.
But that is not related to ingest or bulk.

@probakowski
Copy link
Copy Markdown
Contributor Author

Thanks for review @martijnvg!
I think your first case is checked in testFinalPipelineOfOldDestinationIsNotInvoked.
I've added testDefaultPipelineOfNewDestinationIsNotInvoked for the second one

@probakowski probakowski requested a review from martijnvg July 16, 2020 10:08
@probakowski probakowski added v7.9.1 and removed v7.9.0 labels Jul 16, 2020
@probakowski
Copy link
Copy Markdown
Contributor Author

@elasticmachine update branch

Copy link
Copy Markdown
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

probakowski added a commit to probakowski/elasticsearch that referenced this pull request Jul 17, 2020
…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
probakowski added a commit that referenced this pull request Jul 17, 2020
…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
probakowski added a commit to probakowski/elasticsearch that referenced this pull request Jul 17, 2020
…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
probakowski added a commit that referenced this pull request Jul 17, 2020
…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
@j10sv2
Copy link
Copy Markdown

j10sv2 commented Oct 27, 2020

final pipelines can't change destination anymore, exception is thrown if they try to

This has broken all of my ingest pipelines, but is not called out as a breaking change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>bug :Distributed/Ingest Node Execution or management of Ingest Pipelines Team:Data Management (obsolete) DO NOT USE. This team no longer exists. v7.9.0 v7.10.0 v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Applying destination index pipelines after a processor changes the target index

6 participants