chesnokoff commented on code in PR #12960:
URL: https://github.com/apache/ignite/pull/12960#discussion_r3038121703


##########
modules/core/src/main/java/org/apache/ignite/internal/processors/performancestatistics/FilePerformanceStatisticsReader.java:
##########
@@ -229,15 +233,26 @@ private boolean deserialize(ByteBuffer buf, UUID nodeId, 
boolean firstRecord) th
             throw new IgniteException("Unsupported file format");
 
         if (opType == VERSION) {
-            if (buf.remaining() < OperationType.versionRecordSize())
+            if (buf.remaining() < Short.BYTES)
                 return false;
 
             short ver = buf.getShort();
+            String igniteVer = null;
+
+            if (ver == FILE_FORMAT_VERSION) {
+                ForwardableString verStr = readString(buf);
+
+                if (verStr == null)
+                    return false;
 
-            if (ver != FilePerformanceStatisticsWriter.FILE_FORMAT_VERSION) {
-                throw new IgniteException("Unsupported file format version 
[fileVer=" + ver + ", supportedVer=" +
-                    FilePerformanceStatisticsWriter.FILE_FORMAT_VERSION + ']');
+                igniteVer = verStr.str;
             }
+            else if (ver != LEGACY_FILE_FORMAT_VERSION_1)
+                throw new IgniteException("Unsupported file format version 
[fileVer=" + ver + ", currentVer=" +
+                    FILE_FORMAT_VERSION + ']');
+
+            for (PerformanceStatisticsHandler hnd : curHnd)
+                hnd.version(nodeId, ver, igniteVer);

Review Comment:
   The reader does not have a `log` field, so it would be better to simply 
notify `hnd` about the version. The `PrintHandler` in ignite-extensions can 
then implement the `version` method to handle logging.



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