Skip to content

Commit 40972e2

Browse files
authored
feat(table-coordinator): handle exceptions during snapshot expiration (#2969) (#2970)
1 parent 7d05bf7 commit 40972e2

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

core/src/main/java/kafka/automq/table/coordinator/TableCoordinator.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -388,11 +388,16 @@ public void tryMoveToCommitedStatus() throws Exception {
388388
deleteFiles.forEach(delta::addDeletes);
389389
delta.commit();
390390
}
391-
transaction.expireSnapshots()
392-
.expireOlderThan(System.currentTimeMillis() - TimeUnit.HOURS.toMillis(1))
393-
.retainLast(1)
394-
.executeDeleteWith(EXPIRE_SNAPSHOT_EXECUTOR)
395-
.commit();
391+
try {
392+
transaction.expireSnapshots()
393+
.expireOlderThan(System.currentTimeMillis() - TimeUnit.HOURS.toMillis(1))
394+
.retainLast(1)
395+
.executeDeleteWith(EXPIRE_SNAPSHOT_EXECUTOR)
396+
.commit();
397+
} catch (Exception exception) {
398+
// skip expire snapshot failure
399+
LOGGER.error("[EXPIRE_SNAPSHOT_FAIL],{}", getTable().name(), exception);
400+
}
396401
}
397402

398403
recordMetrics();

0 commit comments

Comments
 (0)