swapna267 opened a new issue, #18797:
URL: https://github.com/apache/iceberg/issues/18797

   ### Apache Iceberg version
   
   1.12.0 (latest release)
   
   ### Query engine
   
   Flink
   
   ### Please describe the bug 🐞
   
     With flink-maintenance.lock.jdbc.init-lock-table=true, two operators in 
the same job open the same JdbcLockFactory and each tries to create the lock 
table:
   
     - 
[TriggerManager](https://github.com/apache/iceberg/blob/main/flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/maintenance/operator/TriggerManager.java#L172)
  calls lockFactory.open() in initializeState.
     - 
[LockRemover](https://github.com/apache/iceberg/blob/main/flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/maintenance/operator/LockRemover.java#L114)
 calls lockFactory.open() in open() (LockRemover.java:114).
   
     JdbcLockFactory.initializeLockTables()  runs CREATE_LOCK_TABLE_SQL only if 
the table is missing. That statement is a plain CREATE TABLE without IF NOT 
EXISTS, so the sequence is check-then-create. If both operators run the
     check before either one has created the table, the second CREATE TABLE 
fails and the task goes to FAILED.
   
   ### Willingness to contribute
   
   - [x] I can contribute a fix for this bug independently
   - [ ] I would be willing to contribute a fix for this bug with guidance from 
the Iceberg community
   - [ ] I cannot contribute a fix for this bug at this time


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to