Skip to content

NIFI-16071 - Enable newly added controller services on versioned flow upgrade - #11390

Merged
exceptionfactory merged 1 commit into
apache:mainfrom
pvillard31:NIFI-16071
Jul 3, 2026
Merged

NIFI-16071 - Enable newly added controller services on versioned flow upgrade#11390
exceptionfactory merged 1 commit into
apache:mainfrom
pvillard31:NIFI-16071

Conversation

@pvillard31

Copy link
Copy Markdown
Contributor

Summary

NIFI-16071 - Enable newly added controller services on versioned flow upgrade

NIFI-15749 made a versioned flow upgrade start/enable components that are newly added in the new version when the process group is active (mirroring the state of the components that were already running). It only worked for newly added processors. A newly added controller service that is referenced solely by an existing processor (via a new property) was left DISABLED after the upgrade, so the referencing processor became invalid and could not run. Controller services are always persisted in a versioned flow as DISABLED (VersionedComponentStateLookup.ENABLED_OR_DISABLED), so the synchronizer's "enable if proposed state is ENABLED" step never selected them, and RetainExistingStateComponentScheduler's "new service + active group -> enable" logic was never handed these services.

What changed:

  • Added ComponentScheduler.enableAddedControllerServicesAsync(...) with a default no-op implementation.
  • StandardVersionedComponentSynchronizer now routes the services that were newly added during synchronization through this method.
  • RetainExistingStateComponentScheduler overrides it to enable those services when the process group is active, consistent with how newly added processors are handled.

Because the new method defaults to a no-op, startup, cluster reconnect, and restore paths are unchanged; only the versioned-flow upgrade path enables newly added controller services.

Added a system test reproducing the scenario (new controller service referenced only by an existing processor across a version change) and unit tests for the scheduler.

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 contains commits signed with a registered key indicating Verified status

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 ./mvnw clean install -P contrib-check
    • JDK 21
    • JDK 25

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

@exceptionfactory exceptionfactory left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for finding and resolving this issue @pvillard31, the adjusted approach for enabling added Controller Services looks good. +1 merging

@exceptionfactory
exceptionfactory merged commit 46fc537 into apache:main Jul 3, 2026
12 of 13 checks passed
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.

2 participants