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


##########
modules/core/src/main/java/org/apache/ignite/internal/processors/metastorage/persistence/DistributedMetaStorageImpl.java:
##########
@@ -961,30 +942,34 @@ private DistributedMetaStorageKeyValuePair[] 
localFullData() {
             DistributedMetaStorageClusterNodeData nodeData = data.commonData();
 
             if (nodeData != null) {
-                if (nodeData.fullData != null) {
-                    ver = nodeData.ver;
+                // Cached unwrapped history.
+                DistributedMetaStorageHistoryItem[] newHist = null;
+
+                if (nodeData.fullDataKeys != null) {
+                    assert nodeData.fullDataValsBytes != null && 
nodeData.fullDataValsBytes.length == nodeData.fullDataKeys.length;
+
+                    ver = new DistributedMetaStorageVersion(nodeData.dVerId, 
nodeData.dVerHash);
 
-                    notifyListenersBeforeReadyForWrite(nodeData.fullData);
+                    notifyListenersBeforeReadyForWrite(nodeData.fullDataKeys, 
nodeData.fullDataValsBytes);
 
                     bridge.writeFullNodeData(nodeData);
                 }
 
                 if (nodeData.hist != null) {
-                    clearHistoryCache();
+                    newHist = 
DistributedMetaStorageHistoryItem.fromMessages(nodeData.hist);
 
-                    for (int i = 0, len = nodeData.hist.length; i < len; i++) {
-                        DistributedMetaStorageHistoryItem histItem = 
nodeData.hist[i];
+                    clearHistoryCache();
 
-                        addToHistoryCache(ver.id() + i - (len - 1), histItem);
-                    }
+                    for (int i = 0, len = newHist.length; i < len; i++)
+                        addToHistoryCache(ver.id() + i - (len - 1), 
newHist[i]);
                 }
 
-                if (isPersistenceEnabled && nodeData.fullData != null)
-                    dataWriter.addUpdateTask(nodeData);
+                if (isPersistenceEnabled && nodeData.fullDataKeys != null)
+                    dataWriter.addUpdateTask(ver, newHist, 
nodeData.fullDataKeys, nodeData.fullDataValsBytes);

Review Comment:
   @Vladsz83 `newHist` still can be null here.



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