wernerdv commented on code in PR #13409:
URL: https://github.com/apache/ignite/pull/13409#discussion_r3690515169


##########
modules/core/src/main/java/org/apache/ignite/internal/processors/metastorage/persistence/DistributedMetaStorageImpl.java:
##########
@@ -821,23 +804,21 @@ private String 
validatePayload(DistributedMetaStorageJoiningNodeData joiningData
 
         DistributedMetaStorageJoiningNodeData joiningData = 
discoData.joiningNodeData();
 
-        DistributedMetaStorageVersion remoteVer = joiningData.ver;
-
         lock.readLock().lock();
 
         try {
             DistributedMetaStorageVersion locVer = ver;
 
-            if (remoteVer.id() >= locVer.id()) {
-                Serializable nodeData = new 
DistributedMetaStorageClusterNodeData(remoteVer, null, null, null);
+            if (joiningData.dVerId >= locVer.id()) {
+                var rmtVer = new 
DistributedMetaStorageVersion(joiningData.dVerId, joiningData.dVerHash);
 
-                dataBag.addGridCommonData(COMPONENT_ID, nodeData);
+                dataBag.addGridCommonData(COMPONENT_ID, new 
DistributedMetaStorageClusterNodeData(rmtVer, null, null, null));
             }
             else {
-                if (locVer.id() - remoteVer.id() <= histCache.size() && 
!dataBag.isJoiningNodeClient()) {
-                    DistributedMetaStorageHistoryItem[] updates = 
history(remoteVer.id() + 1, locVer.id());
+                if (locVer.id() - joiningData.dVerId <= histCache.size() && 
!dataBag.isJoiningNodeClient()) {
+                    DistributedMetaStorageHistoryItem[] updates = 
history(joiningData.dVerId + 1, locVer.id());
 
-                    Serializable nodeData = new 
DistributedMetaStorageClusterNodeData(ver, null, null, updates);
+                    var nodeData = new 
DistributedMetaStorageClusterNodeData(ver, null, null, updates);

Review Comment:
   Can be inlined (also on line 837), but up to you.



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