Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NIFI-11473 Flow version change in NiFi should not stop a component wh… #7185

Closed
wants to merge 1 commit into from

Conversation

timeabarna
Copy link
Contributor

@timeabarna timeabarna commented Apr 20, 2023

…en only position is changed

Summary

When going from one flow version to another and the position of a component is changing, but not its configuration, the component should not be stopped.

NIFI-11473

Tracking

Please complete the following tracking steps prior to pull request creation.

Issue Tracking

Pull Request Tracking

  • Pull Request title starts with Apache NiFi Jira issue number, such as NIFI-00000
  • Pull Request commit message starts with Apache NiFi Jira issue number, as such NIFI-00000

Pull Request Formatting

  • Pull Request based on current revision of the main branch
  • Pull Request refers to a feature branch with one commit containing changes

Verification

Please indicate the verification steps performed prior to pull request creation.

Build

  • Build completed using mvn clean install -P contrib-check
    • JDK 11
    • JDK 17

Licensing

  • New dependencies are compatible with the Apache License 2.0 according to the License Policy
  • New dependencies are documented in applicable LICENSE and NOTICE files

Documentation

  • Documentation formatting appears as expected in rendered files

@mattyb149
Copy link
Contributor

Reviewing...

@mattyb149
Copy link
Contributor

Is there a reproduction path for this? Using the registry I started the processor then saved the version. Then I moved the processor and committed the changes. When I change version back, it appears to set the desired version but the processor is not stopped (although a dialog pops up saying . This is without the fix in this PR, so I'm thinking there's a different way to reproduce this behavior?

@timeabarna
Copy link
Contributor Author

Hello @mattyb149,

I've created a GenerateFlowFile processor which is running. Created a version where only position changed.
Added debug point at FlowUpdateResource updateFlow method and a debug point to StandardVersionedFlowSynchronizer updateProcessor method.

At version change, without patch:
FlowUpdateResource updateFlow runningComponents set contains GenerateFlowFile processor.
StandardVersionedFlowSynchronizer updateProcessor goes to the updateProcessor if branch
nifi-app.log shows FlowUpdateResource Stopping 1 Processors and FlowUpdateResource Restarting 1 Processors

With patch:
FlowUpdateResource updateFlow runningComponents set empty.
StandardVersionedFlowSynchronizer updateProcessor goes to the setPosition if branch
nifi-app.log shows FlowUpdateResource Stopping 0 Processors and FlowUpdateResource Restarting 0 Processors
If my memory serves well only Updating Flow can be seen on UI.

@pvillard31
Copy link
Contributor

pvillard31 commented Apr 25, 2023

What I usually do to check this:

  • have a GenerateFlowFile to InvokeHTTP
  • have a ListenHTTP

Version this is as v1.

Move the ListenHTTP processor. Version this is as v2.
With processors running, without the fix, v1 to v2 would generate errors because ListenHTTP is restarted and InvokeHTTP cannot send data during the restart. With the fix, there should be no error.

@mattyb149
Copy link
Contributor

+1 LGTM, reproduced without the PR and verified the behavior with the PR is as expected. Thanks for the fix! Merging to main and 1.x

@mattyb149 mattyb149 closed this in d54940c Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants