N-o-Z opened a new issue, #9485:
URL: https://github.com/apache/iceberg/issues/9485

   ### Apache Iceberg version
   
   1.4.2 (latest release)
   
   ### Query engine
   
   None
   
   ### Please describe the bug 🐞
   
   The last part of the commit flow, requires writing the new metadata version 
file which uses the renameToFinal method.
   In this method there's a use of the lock manager to ensure no 2 committers 
write the same metadata version file.
   However, when trying to acquire lock, there's no check if the lock was 
actually acquired:
   ```Java
       private void renameToFinal(FileSystem fs, Path src, Path dst, int 
nextVersion) {
           try {
               this.lockManager.acquire(dst.toString(), src.toString());
               if (fs.exists(dst)) {
                   throw new CommitFailedException("Version %d already exists: 
%s", new Object[]{nextVersion, dst});
               }
               ...
   ```
   
   In the LockManager interface, acquire documentation states:
   ```
   Try to acquire a lock
   Params: entityId – ID of the entity to lock 
                 ownerId – ID of the owner if the lock
   Returns:
   if the lock for the entity is acquired by the owner
   ```
   
   I'm fairly new to the Iceberg ecosystem, so if I'm misunderstanding 
something in the code I would greatly appreciate an explanation.


-- 
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: issues-unsubscr...@iceberg.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to