ncover21 commented on PR #11240:
URL: https://github.com/apache/nifi/pull/11240#issuecomment-5027296614
The migration-complete path doesn't persist configuration through the
`ConnectorConfigurationProvider`.
`StandardConnectorRepository.notifyMigrationComplete(...)` only invokes the
`ConnectorConfigurationProvider.migrationComplete(...)` hook, which is a
default no-op. Unlike `configureConnector(...)` / `updateConnector(...)`, it
never calls `configurationProvider.save(...)`. So a provider that persists
working configuration externally (rather than relying solely on `flow.json.gz`)
never receives the migrated configuration after a commit - the externally
persisted config stays absent/stale until some later configure/update call
triggers a `save`.
The repository already has what's needed to close this: the `connectors`
map, the `configurationProvider` reference, and the existing
`buildWorkingConfiguration(ConnectorNode)` helper the configure/update paths
use. So the save can live entirely in the repository:
```java
public void notifyMigrationComplete(String connectorId, String
sourceProcessGroupId) {
if (configurationProvider != null) {
ConnectorNode connector = connectors.get(connectorId);
if (connector != null) {
configurationProvider.save(connectorId,
buildWorkingConfiguration(connector));
}
configurationProvider.migrationComplete(connectorId,
sourceProcessGroupId);
}
}
```
Working-vs-active is safe here: `commitMigratedConfiguration(...)` writes
the merged config onto the active context and then calls
`recreateWorkingFlowContext()`, and `notifyMigrationComplete(...)` runs after
the commit, so `buildWorkingConfiguration(connector)` (which reads the working
context) reflects the migrated configuration at that point.
--
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]