rocketmq icon indicating copy to clipboard operation
rocketmq copied to clipboard

transaction message commit success still checkLocalTransaction

Open LiveAlone opened this issue 4 years ago • 4 comments

RocketMqServer 4.4.0 server broker get WARN log,

2020-10-16 12:58:15 WARN EndTransactionThread_35 - Check producer[172.20.153.16:41418] transaction state, the producer commit the message.RequestHeader: EndTransactionRequestHeader{producerGroup='XXXX', tranStateTableOffset=28244998, commitLogOffset=36496939284664, commitOrRollback=8, fromTransactionCheck=true, msgId='AC192B7A0001762EFE5D5007AF76A48F', transactionId='AC192B7A0001762EFE5D5007AF76A48F'} Remark: null

in prod env, some transaction msg comment success, rocketBroker still checkLocalTransaction。 in test env is fine。

LiveAlone avatar Oct 19 '20 05:10 LiveAlone

You can check the network between your prod env machine and your producer machine.

maixiaohai avatar Oct 19 '20 12:10 maixiaohai

        LocalTransactionState localTransactionState = LocalTransactionState.UNKNOW;
        Throwable localException = null;
        switch (sendResult.getSendStatus()) {
            case SEND_OK: {
                try {
                    if (sendResult.getTransactionId() != null) {
                        msg.putUserProperty("__transactionId__", sendResult.getTransactionId());
                    }
                    String transactionId = msg.getProperty(MessageConst.PROPERTY_UNIQ_CLIENT_MESSAGE_ID_KEYIDX);
                    if (null != transactionId && !"".equals(transactionId)) {
                        msg.setTransactionId(transactionId);
                    }
                    if (null != localTransactionExecuter) {
                        localTransactionState = localTransactionExecuter.executeLocalTransactionBranch(msg, arg);
                    } else if (transactionListener != null) {
                        log.debug("Used new transaction API");
                        localTransactionState = transactionListener.executeLocalTransaction(msg, arg);
                    }
                    if (null == localTransactionState) {
                        localTransactionState = LocalTransactionState.UNKNOW;
                    }

                    if (localTransactionState != LocalTransactionState.COMMIT_MESSAGE) {
                        log.info("executeLocalTransactionBranch return {}", localTransactionState);
                        log.info(msg.toString());
                    }
                } catch (Throwable e) {
                    log.info("executeLocalTransactionBranch exception", e);
                    log.info(msg.toString());
                    localException = e;
                }
            }
            break;
            case FLUSH_DISK_TIMEOUT:
            case FLUSH_SLAVE_TIMEOUT:
            case SLAVE_NOT_AVAILABLE:
                localTransactionState = LocalTransactionState.ROLLBACK_MESSAGE;
                break;
            default:
                break;
        }

        try {
            this.endTransaction(sendResult, localTransactionState, localException);
        } catch (Exception e) {
            log.warn("local transaction execute " + localTransactionState + ", but end broker transaction failed", e);
        }

i not find log info,

  1. local transaction execute fail, get log.info("executeLocalTransactionBranch return {}", localTransactionState); log.info("executeLocalTransactionBranch exception", e)
  2. end transaction exception get log log.warn("local transaction execute " + localTransactionState + ", but end broker transaction failed", e);

it seems client submit success, server log get WARN EndTransactionThread,

LiveAlone avatar Oct 21 '20 09:10 LiveAlone

upgrade to 4.6.x or upper may resolve your problem.

and keep transientStorePoolEnable=false

areyouok avatar Jan 04 '21 05:01 areyouok

The problem still exists version:4.7.1 config:transientStorePoolEnable=false

hellodake avatar Jul 29 '22 03:07 hellodake

This issue is stale because it has been open for 365 days with no activity. It will be closed in 3 days if no further activity occurs.

github-actions[bot] avatar Jul 30 '23 00:07 github-actions[bot]

This issue was closed because it has been inactive for 3 days since being marked as stale.

github-actions[bot] avatar Aug 03 '23 00:08 github-actions[bot]