sergey-chugunov-1985 commented on code in PR #13456:
URL: https://github.com/apache/ignite/pull/13456#discussion_r3747325254


##########
modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java:
##########
@@ -1597,6 +1600,16 @@ else if (U.millisSinceNanos(joinStartNanos) > 
spi.joinTimeout)
 
                 errs.add(e);
 
+                if (e instanceof UnsupportedNodeVersionException) {
+                    LT.error(log, e, "Failed to initialize a connection with 
the remote node. The remote node is running" +
+                        " components with an incompatible versions, so the 
nodes cannot agree on serialization protocol" +
+                        " [rmtAddr=" + addr + ']');

Review Comment:
   It may be a good idea to include error message from 
UnsupportedNodeVersionException to the log entry printed here.
   
   Also why not to move this logic into a separate catch block handling 
UnsupportedNodeVersionException specifically?



##########
modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java:
##########
@@ -1686,6 +1694,40 @@ Socket createSocket() throws IOException {
         }
     }
 
+    /** */
+    IgniteNodeFeatureSet localNodeFeatures() {
+        return locNodeFeatures;
+    }
+
+    /** */
+    void validateRemoteFeatures(IgniteNodeFeatureSet rmtFeatures) throws 
IgniteCheckedException {
+        if (rmtFeatures == null)
+            throw new UnsupportedNodeVersionException("Remote node component 
versions are not supported" +
+                " [locComponents=" + locNodeFeatures +
+                ", rmtComponents=" + rmtFeatures + ']');
+
+        for (IgniteComponentFeatureSet rmtCmpFeatures : rmtFeatures.values()) {
+            IgniteComponentFeatureSet locCmpFeatures = 
locNodeFeatures.componentFeatures(rmtCmpFeatures.componentName());
+
+            if (locCmpFeatures == null)
+                continue;
+
+            int c = 
locCmpFeatures.version().compareTo(rmtCmpFeatures.version());
+
+            if (c == 0)
+                continue;
+
+            IgniteComponentFeatureSet src = c > 0 ? rmtCmpFeatures : 
locCmpFeatures;
+            IgniteComponentFeatureSet target = c > 0 ? locCmpFeatures : 
rmtCmpFeatures;
+
+            if (!src.isUpgradableTo(target)) {
+                throw new UnsupportedNodeVersionException("Remote node 
component versions are not supported" +

Review Comment:
   I suggest to use different error message here instead of reusing the same 
message as for the situation when remote node features are null.
   
   This would allow users to distinguish these situations, right now it is not 
possible solely by error message.



-- 
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