zncleon commented on issue #15487:
URL: https://github.com/apache/iceberg/issues/15487#issuecomment-3990481745
My builder is created like this(in Separate Maintenance Job):
```
Map<String, String> jdbcProps = new HashMap<>();
jdbcProps.put("jdbc.user", "user_xxx");
jdbcProps.put("jdbc.password", "password_xxx");
jdbcProps.put("flink-maintenance.lock.jdbc.init-lock-tables", "true");
TriggerLockFactory lockFactory = new JdbcLockFactory(
"jdbc:mysql://xxx/iceberg?useSSL=false&serverTimezone=UTC&autoReconnect=true",
"xxx_id", // Lock ID
jdbcProps // JDBC connection properties
);
TableMaintenance.Builder builder = TableMaintenance.forTable(env,
tableLoader, lockFactory);
if (builder != null) {
System.out.println("TableMaintenance.Builder created successfully");
}
builder.uidSuffix("iceberg-table-maintenance-job")
.rateLimit(Duration.ofSeconds(60))
.lockCheckDelay(Duration.ofSeconds(30))
.parallelism(8)
.add(ExpireSnapshots.builder()
.scheduleOnInterval(Duration.ofHours(1))
.maxSnapshotAge(Duration.ofHours(3)))
.add(DeleteOrphanFiles.builder()
.scheduleOnInterval(Duration.ofHours(1))
.minAge(Duration.ofHours(1)))
.append();
```
I can see logs like this:
```
2026-03-03 19:02:16.000072 INFO JdbcLockFactory:258 - Deleted
JdbcLock{type=MAINTENANCE, lockId=xxx_id} lock with instanceId
99ad9ec8-ee80-4518-b994-09b1f4f4ab03 with row count 1
2026-03-03 19:03:43.000308 INFO JdbcLockFactory:189 - Created
JdbcLock{type=MAINTENANCE, lockId=xxx_id} lock with instanceId
1f8967fa-167b-4cdb-9eba-c1ba1c3d93f7 with row count 1
2026-03-03 19:10:43.000590 INFO JdbcLockFactory:176 - Lock is already held
for JdbcLock{type=MAINTENANCE, lockId=xxx_id}
2026-03-03 19:10:43.000590 INFO TriggerManager:257 - Failed to acquire
lock. Delaying task to 1772536273584
```
--
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]