s9514171 commented on a change in pull request #4745:
URL: https://github.com/apache/nifi/pull/4745#discussion_r559356471
##########
File path:
nifi-commons/nifi-site-to-site-client/src/main/java/org/apache/nifi/remote/client/AbstractPeerPersistence.java
##########
@@ -44,11 +44,19 @@ protected PeerStatusCache restorePeerStatuses(final
BufferedReader reader,
return null;
}
+ final String remoteInstanceUris;
+ remoteInstanceUris = String.valueOf(reader.readLine());
+ if (remoteInstanceUris == null ||
!remoteInstanceUris.matches("(.+)://(.+):(.+)/nifi-api(.*)")) {
Review comment:
I added a variable REMOTE_INSTANCE_URIS_PREFIX as a prefix and checked
if the line starts with it when restoring the peers.
the variable used when writing/restoring and unit test
##########
File path:
nifi-commons/nifi-site-to-site-client/src/main/java/org/apache/nifi/remote/client/PeerSelector.java
##########
@@ -106,6 +106,16 @@ private void restoreInitialPeerStatusCache() {
final SiteToSiteTransportProtocol currentProtocol =
peerStatusProvider.getTransportProtocol();
final SiteToSiteTransportProtocol cachedProtocol =
restoredPeerStatusCache.getTransportProtocol();
+ final String currentRemoteInstanceUris =
peerStatusProvider.getRemoteInstanceUris();
+ final String cachedRemoteInstanceUris =
restoredPeerStatusCache.getRemoteInstanceUris();
+
+ // If the remote instance URIs have changed, clear the
cache
+ if
(!currentRemoteInstanceUris.equals(cachedRemoteInstanceUris)) {
+ logger.warn("Discard stored peer statuses in {}
because remote instance URIs has changed from {} to {}",
Review comment:
changed to INFO
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]