cuibo01 commented on a change in pull request #4880:
URL: https://github.com/apache/hudi/pull/4880#discussion_r831684304



##########
File path: 
hudi-common/src/main/java/org/apache/hudi/common/table/log/block/HoodieDeleteBlock.java
##########
@@ -86,15 +88,25 @@ public HoodieDeleteBlock(Option<byte[]> content, 
FSDataInputStream inputStream,
         int dataLength = dis.readInt();
         byte[] data = new byte[dataLength];
         dis.readFully(data);
-        this.keysToDelete = SerializationUtils.<HoodieKey[]>deserialize(data);
+        this.recordsToDelete = deserialize(version, data);
         deflate();
       }
-      return keysToDelete;
+      return recordsToDelete;
     } catch (IOException io) {
       throw new HoodieIOException("Unable to generate keys to delete from 
block content", io);
     }
   }
 
+  private static DeleteRecord[] deserialize(int version, byte[] data) {
+    if (version == 1) {
+      // legacy version
+      HoodieKey[] keys = SerializationUtils.<HoodieKey[]>deserialize(data);

Review comment:
       I think adding log to tell the user that there is an delete record of 
old version, it may cause data loss.




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