wecharyu commented on code in PR #10886:
URL: https://github.com/apache/hudi/pull/10886#discussion_r1532367467


##########
hudi-common/src/main/java/org/apache/hudi/common/model/HoodiePartitionMetadata.java:
##########
@@ -92,11 +92,12 @@ public int getPartitionDepth() {
 
   /**
    * Write the metadata safely into partition atomically.
+   * To avoid concurrent write into the same partition (for example in 
speculative case),
+   * please make sure writeToken is unique.
    */
-  public void trySave(int taskPartitionId) {
+  public void trySave(String writeToken) throws IOException {

Review Comment:
   It's good to reuse such write file code, but `fs` is not 
`HoodieWrapperFileSystem` in this class, it's not easy to reuse 
`createImmutableFileInPath()` method here, do we need move this method into 
`FSUtils`?
   
https://github.com/apache/hudi/blob/7c55ac35ba11ed00151bf9d536aecdb5d83af33f/hudi-common/src/main/java/org/apache/hudi/common/model/HoodiePartitionMetadata.java#L61
   
   As for writeToken and UUID, we prefer writeToken because it includes the 
task partition info which is useful in debug, pls let me know your idea.



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