github-actions[bot] commented on code in PR #64650:
URL: https://github.com/apache/doris/pull/64650#discussion_r3503842642
##########
fe/fe-core/src/main/java/org/apache/doris/datasource/InternalCatalog.java:
##########
@@ -1828,30 +1833,45 @@ public void addPartition(Database db, String tableName,
AddPartitionOp addPartit
}
if (!isCreateTable) {
- afterCreatePartitions(db.getId(), olapTable.getId(),
partitionIds, indexIds, isCreateTable,
- false /* isBatchCommit */, olapTable);
+ try {
+ afterCreatePartitions(db.getId(), olapTable.getId(),
partitionIds, indexIds, isCreateTable,
+ false /* isBatchCommit */, olapTable);
+ } catch (Throwable t) {
+ if (rollbackPartitionInfoWithTableLock(db, tableName,
partitionId, partitionInfoUpdated,
Review Comment:
`CloudInternalCatalog.afterCreatePartitions()` is not an all-or-nothing
pre-publish step: in the non-batch path it calls `commitPartition()` first, and
only after that runs the default-enabled `checkCreatePartitions()` validation.
If that post-commit check returns non-OK or throws, this catch rolls back FE
`PartitionInfo` and rethrows before the edit log/table publish, but the
meta-service partition has already been committed. That leaves FE reporting ADD
PARTITION failure and dropping the local metadata while cloud metadata has
advanced. Please separate the remote commit success from the post-commit
validation here, so this rollback only runs for failures before the cloud
commit, or complete/compensate the committed partition instead of treating
every `afterCreatePartitions()` exception as safe to roll back locally.
--
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]