Skip to content

When implicit XA transaction fail to commit and is automatically rollbacked, the real error should be returned to the user instead of OK packet. #1170

@tankilo

Description

@tankilo
  • dble version:
  • preconditions :
    no
  • configs:

schema.xml

<table name="xa_test" dataNode="dn1,dn2" rule="sharding-by-mod2" primaryKey="ID"/>

rule.xml

<tableRule name="sharding-by-mod2">
        <rule>
            <columns>id</columns>
            <algorithm>hashmod2</algorithm>
        </rule>
    </tableRule>
    <function name="hashmod2" class="Hash">
        <property name="partitionCount">2</property>
        <property name="partitionLength">1</property>
    </function>

server.xml



steps:

step1. executing following command

delete from xa_test;
INSERT INTO xa_test (id) VALUES(1),(2),(3);
set xa=1;
delete from xa_test;

Before you execute delete from xa_test; the second time, set a break point in method com.actiontech.dble.backend.mysql.nio.handler.transaction.xa.XACommitNodesHandler#preparePhase
image

step2. kill connection manually to imitate the network failure

image

step3 check result of the second delete statement

image

  • expect result:
    1. If the implicit transaction failed to commit and is rollbacked automatically
      (DML executed sucessfully but xa prepare run into network failure) , then error message that 【indicate the fact of auto-rollback behaviour】 and 【the real error message】 should be returned to the user.
  • real result:
    1. It's OK Packet...
  • supplements:
    1.

/label ~BUG

Metadata

Metadata

Assignees

Labels

communityissue from communityresolveproblem has been fixed by developer

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions