github-actions[bot] commented on code in PR #61881:
URL: https://github.com/apache/doris/pull/61881#discussion_r3098288141
##########
fe/fe-core/src/main/java/org/apache/doris/cloud/transaction/CloudGlobalTransactionMgr.java:
##########
@@ -2343,9 +2369,11 @@ public TransactionState getTransactionState(long dbId,
long transactionId) {
return null;
}
- if (getTxnResponse.getStatus().getCode() != MetaServiceCode.OK ||
!getTxnResponse.hasTxnInfo()) {
- LOG.info("getTransactionState exception: {}, {}",
getTxnResponse.getStatus().getCode(),
- getTxnResponse.getStatus().getMsg());
+ if (getTxnResponse == null || getTxnResponse.getStatus().getCode() !=
MetaServiceCode.OK
Review Comment:
Because `getTransactionState()` now decides whether we ever invoke
`afterAborted()`, the no-retry/null-return behavior here becomes
correctness-critical. A transient `KV_TXN_CONFLICT` or `RpcException` on
`getTxn()` makes `handleBeforeAbort()` return `cb == null`, but
`abortTransactionImpl()` below can still succeed after its own retries. Since
`handleAfterAbort()` no longer falls back to
`abortTxnResponse.getTxnInfo().getCallbackId()`, that successful abort will
skip `afterAborted()` entirely. For routine load that drops task renewal; for
delete jobs it leaves the callback registered. Please either retry this
pre-query like `getLabelState()` does, or recover the callback id safely from
the abort response.
##########
fe/fe-core/src/main/java/org/apache/doris/load/DeleteJob.java:
##########
@@ -239,6 +239,11 @@ public void afterVisible(TransactionState txnState,
boolean txnOperated) {
@Override
public void afterAborted(TransactionState txnState, boolean txnOperated,
String txnStatusChangeReason) {
+ if (!txnOperated) {
Review Comment:
`txnOperated == false` does not imply "the txn is still PREPARE" in this
path. `afterAbortTxnResp()` also maps already-final responses such as
`TXN_ALREADY_ABORTED` / `TXN_ID_NOT_FOUND` into exceptions, but
`handleAfterAbort()` still invokes this callback from `finally` with
`txnOperated = false`. Returning here keeps the delete-job callback registered
even though `DeleteHandler.clearJob()` explicitly leaves cleanup to
`afterAborted()` / `afterVisible()`, and there may be no later callback for a
final txn. This looks like a callback leak on duplicate/late cancel paths.
--
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]