This is an automated email from the ASF dual-hosted git repository. yuqi4733 pushed a commit to branch internal-main in repository https://gitbox.apache.org/repos/asf/gravitino.git
commit c290e863d878b3214c1aa02fbfe6190c3c52c6d4 Author: Mini Yu <[email protected]> AuthorDate: Fri Dec 12 11:47:41 2025 +0800 [Minor]: fix(core): change session handling to doWithoutCommit for soft delete operations (#9466) ### What changes were proposed in this pull request? Replace `doWithCommit` with `doWithoutCommit` in `TableMetaService#deleteTable` ### Why are the changes needed? We should not use `doWithCommit` within `doMultipleWithCommit`, or it can't be rollbacked when someting unexpected happens. ### Does this PR introduce _any_ user-facing change? N/A. ### How was this patch tested? Existing tests. --- .../gravitino/storage/relational/service/MetalakeMetaService.java | 4 ++-- .../gravitino/storage/relational/service/TableMetaService.java | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/org/apache/gravitino/storage/relational/service/MetalakeMetaService.java b/core/src/main/java/org/apache/gravitino/storage/relational/service/MetalakeMetaService.java index 9e10410e2d..14838bbca1 100644 --- a/core/src/main/java/org/apache/gravitino/storage/relational/service/MetalakeMetaService.java +++ b/core/src/main/java/org/apache/gravitino/storage/relational/service/MetalakeMetaService.java @@ -372,12 +372,12 @@ public class MetalakeMetaService { SessionUtils.doMultipleWithCommit( () -> metalakeDeleteCount[0] = - SessionUtils.doWithCommitAndFetchResult( + SessionUtils.getWithoutCommit( MetalakeMetaMapper.class, mapper -> mapper.deleteMetalakeMetasByLegacyTimeline(legacyTimeline, limit)), () -> ownerRelDeleteCount[0] = - SessionUtils.doWithCommitAndFetchResult( + SessionUtils.getWithoutCommit( OwnerMetaMapper.class, mapper -> mapper.deleteOwnerMetasByLegacyTimeline(legacyTimeline, limit))); return metalakeDeleteCount[0] + ownerRelDeleteCount[0]; diff --git a/core/src/main/java/org/apache/gravitino/storage/relational/service/TableMetaService.java b/core/src/main/java/org/apache/gravitino/storage/relational/service/TableMetaService.java index 092263a990..7c67cfe460 100644 --- a/core/src/main/java/org/apache/gravitino/storage/relational/service/TableMetaService.java +++ b/core/src/main/java/org/apache/gravitino/storage/relational/service/TableMetaService.java @@ -137,7 +137,7 @@ public class TableMetaService { } }), () -> - SessionUtils.doWithCommit( + SessionUtils.doWithoutCommit( TableVersionMapper.class, mapper -> { if (overwrite) { @@ -211,7 +211,7 @@ public class TableMetaService { TableMetaMapper.class, mapper -> mapper.updateTableMeta(newTablePO, oldTablePO, newSchemaId))), () -> - SessionUtils.doWithCommit( + SessionUtils.doWithoutCommit( TableVersionMapper.class, mapper -> { mapper.softDeleteTableVersionByTableIdAndVersion( @@ -289,7 +289,7 @@ public class TableMetaService { mapper -> mapper.softDeletePolicyMetadataObjectRelsByTableId( namespacedEntityId.entityId())); - SessionUtils.doWithCommit( + SessionUtils.doWithoutCommit( TableVersionMapper.class, mapper -> mapper.softDeleteTableVersionByTableIdAndVersion(
