mcgilman opened a new pull request, #11678:
URL: https://github.com/apache/nifi/pull/11678

   # Summary
   
   [NIFI-16337](https://issues.apache.org/jira/browse/NIFI-16337)
   
   Adds a **Stop sources** operation for Standard Process Groups. This allows 
upstream source components to be stopped while downstream components remain 
running and continue processing queued FlowFiles.
   
   ## Implementation
   
   - Adds `PUT /flow/process-groups/{id}/sources`.
   - Identifies active source processors, public input ports, and remote output 
ports recursively.
   - Excludes components belonging to Stateless Process Groups.
   - Rejects requests targeting a Process Group that resolves to the Stateless 
execution engine.
   - Exposes `resolvedExecutionEngine` on Process Group flow, DTO, and entity 
payloads.
   - Adds toolkit client support and Flow Designer state, effects, and 
context-menu integration.
   - Adds cluster response merging for component revisions returned by each 
node.
   
   ## Design and Safety Decisions
   
   ### Cluster consistency
   
   The coordinator identifies the source components and replicates that fixed 
component set and its revisions to every node.
   
   Each node independently recalculates its source set and requires exact set 
equality before scheduling. Set equality is order-independent, so map 
serialization order does not affect validation. If any node identifies a 
different set, phase-one validation rejects the request and no node performs 
the operation.
   
   ### Authorization
   
   The endpoint authorizes read access to `/flow` before execution-engine 
verification or source discovery. It then authorizes the scheduling operation 
for every requested source before validating the supplied source set.
   
   This prevents unauthorized callers from using validation responses to 
inspect flow state and preserves all-or-nothing component authorization.
   
   ### Stateless Process Groups
   
   A Stateless target is rejected because its components cannot be scheduled 
individually through this operation. When a Standard parent contains Stateless 
descendants, those descendants are skipped and remain running.
   
   ### Limited Process Group visibility
   
   `resolvedExecutionEngine` is promoted to `ProcessGroupEntity`, allowing 
clients to determine whether the operation is supported even when the nested 
Process Group DTO is omitted because the user cannot read that Process Group.
   
   ## Test Coverage
   
   - Source classification across processors, ports, remote ports, loops, 
nested groups, and component states.
   - Stateless target rejection and Stateless descendant exclusion.
   - Authorization ordering and all-or-nothing component authorization.
   - Exact source-set validation before replication and under the write lock.
   - Cluster response merging.
   - Flow Designer action, effect, state, and context-menu behavior.
   - Two-node system tests covering:
     - Successful source stopping with Stateless descendants left running.
     - Direct Stateless target rejection.
     - Client-supplied source-set mismatch rejection.
     - Cross-node source-state divergence with matching revisions, verifying 
phase-one rejection without mutation.
   
   # Tracking
   
   Please complete the following tracking steps prior to pull request creation.
   
   ### Issue Tracking
   
   - https://issues.apache.org/jira/browse/NIFI-16337
   
   ### 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](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits)
 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
   
   ### Targeted Backend Tests
   
   - `StandardNiFiServiceFacadeTest`
   - `TestFlowResource`
   - `StopSourcesEndpointMergerTest`
   - `DtoFactoryTest`
   - `EntityFactoryTest`
   
   ### Clustered System Tests
   
   ```text
   ./mvnw -pl nifi-system-tests/nifi-system-test-suite \
     verify -P integration-tests -Dit.test=ClusteredStopSourcesIT
   ```
   
   Result: 4 tests passed.
   
   ### Frontend
   
   - `npx nx test nifi` — 329 test files and 2,831 tests passed
   - `npx nx lint nifi`
   
   ### Static Analysis
   
   - Checkstyle and PMD passed for the modified Maven modules.
   - Toolkit client tests passed.
   - Runtime packaging artifacts were rebuilt before running system tests.
   
   ### Build
   
   - [ ] Build completed using `./mvnw clean install -P contrib-check`
     - [ ] JDK 21
     - [ ] JDK 25
   
   ### Licensing
   
   No new dependencies were introduced.
   
   - [ ] New dependencies are compatible with the [Apache License 
2.0](https://apache.org/licenses/LICENSE-2.0) according to the [License 
Policy](https://www.apache.org/legal/resolved.html)
   - [ ] New dependencies are documented in applicable `LICENSE` and `NOTICE` 
files
   
   ### Documentation
   
   No rendered documentation changes.
   
   - [ ] Documentation formatting appears as expected in rendered files


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to