apache / apache/incubator-seata-samples
数据表修改涉及byte型字段会导致回滚失败,原因是:check dirty datas failed, old and new data are not equal
- Dominant language
- Java
- Stars
- 2.4k
- Forks
- 2k
- PR merge metrics
- No merged PRs in 30d
Description
2019-07-24 15:06:24.390 INFO [user-service,,,] [user-service,,,] 26762 --- [atch_RMROLE_5_8] io.seata.rm.AbstractRMHandler : Branch Rollbacking: 192.168.1.100:8091:2017677666 2017677667 jdbc:mysql://118.31.7.78:3306/new_inx_changingsteam
2019-07-24 15:06:24.435 DEBUG [user-service,,,] [user-service,,,] 26762 --- [atch_RMROLE_5_8] i.s.r.d.undo.AbstractUndoExecutor : check dirty datas failed, old and new data are not equal,tableName:[edu_user],oldRows:[[{"fields":[{"keyType":"PrimaryKey","name":"user_id","type":4,"value":916046955},{"keyType":"NULL","name":"age","type":4,"value":0},{"keyType":"NULL","name":"area","type":4,"value":0},{"keyType":"NULL","name":"banner_url","type":12},{"keyType":"NULL","name":"birth","type":12},{"keyType":"NULL","name":"city","type":4,"value":0},{"keyType":"NULL","name":"create_time","type":93},{"keyType":"NULL","name":"email","type":12},{"keyType":"NULL","name":"idCardNo","type":12},{"keyType":"NULL","name":"invitationCode","type":12},{"keyType":"NULL","name":"is_avalible","type":4,"value":1},{"keyType":"NULL","name":"last_system_time","type":91},{"keyType":"NULL","name":"login_account","type":12},{"keyType":"NULL","name":"mobile","type":12},{"keyType":"NULL","name":"msg_num","type":4,"value":0},{"keyType":"NULL","name":"openId","type":12},{"keyType":"NULL","name":"password","type":12},{"keyType":"NULL","name":"pic_img","type":12},{"keyType":"NULL","name":"province","type":4,"value":0},{"keyType":"NULL","name":"realName","type":12},{"keyType":"NULL","name":"register_from","type":12},{"keyType":"NULL","name":"school","type":12},{"keyType":"NULL","name":"sex","type":4,"value":0},{"keyType":"NULL","name":"show_name","type":-4,"value":"MTIzNDU="},{"keyType":"NULL","name":"subject","type":12},{"keyType":"NULL","name":"sys_msg_num","type":4,"value":0},{"keyType":"NULL","name":"user_name","type":12},{"keyType":"NULL","name":"user_type","type":4,"value":1}]}]],newRows:[[{"fields":[{"keyType":"PrimaryKey","name":"user_id","type":4,"value":916046955},{"keyType":"NULL","name":"age","type":4,"value":0},{"keyType":"NULL","name":"area","type":4,"value":0},{"keyType":"NULL","name":"banner_url","type":12},{"keyType":"NULL","name":"birth","type":12},{"keyType":"NULL","name":"city","type":4,"value":0},{"keyType":"NULL","name":"create_time","type":93},{"keyType":"NULL","name":"email","type":12},{"keyType":"NULL","name":"idCardNo","type":12},{"keyType":"NULL","name":"invitationCode","type":12},{"keyType":"NULL","name":"is_avalible","type":4,"value":1},{"keyType":"NULL","name":"last_system_time","type":91},{"keyType":"NULL","name":"login_account","type":12},{"keyType":"NULL","name":"mobile","type":12},{"keyType":"NULL","name":"msg_num","type":4,"value":0},{"keyType":"NULL","name":"openId","type":12},{"keyType":"NULL","name":"password","type":12},{"keyType":"NULL","name":"pic_img","type":12},{"keyType":"NULL","name":"province","type":4,"value":0},{"keyType":"NULL","name":"realName","type":12},{"keyType":"NULL","name":"register_from","type":12},{"keyType":"NULL","name":"school","type":12},{"keyType":"NULL","name":"sex","type":4,"value":0},{"keyType":"NULL","name":"show_name","type":-4,"value":"MTIzNDU="},{"keyType":"NULL","name":"subject","type":12},{"keyType":"NULL","name":"sys_msg_num","type":4,"value":0},{"keyType":"NULL","name":"user_name","type":12},{"keyType":"NULL","name":"user_type","type":4,"value":1}]}]].
2019-07-24 15:06:24.450 INFO [user-service,,,] [user-service,,,] 26762 --- [atch_RMROLE_5_8] i.seata.rm.datasource.DataSourceManager : branchRollback failed reason [2017677667/192.168.1.100:8091:2017677666]
2019-07-24 15:06:24.450 INFO [user-service,,,] [user-service,,,] 26762 --- [atch_RMROLE_5_8] io.seata.rm.AbstractRMHandler : Branch Rollbacked result: PhaseTwo_RollbackFailed_Retryable
2019-07-24 15:06:24.450 DEBUG [user-service,,,] [user-service,,,] 26762 --- [atch_RMROLE_5_8] i.s.core.rpc.netty.RmMessageListener : branch rollback result:xid=192.168.1.100:8091:2017677666,branchId=2017677667,branchStatus=PhaseTwo_RollbackFailed_Retryable,result code =Success,getMsg =null
2019-07-24 15:06:24.450 DEBUG [user-service,,,] [user-service,,,] 26762 --- [atch_RMROLE_5_8] i.s.core.rpc.netty.AbstractRpcRemoting : send response:xid=192.168.1.100:8091:2017677666,branchId=2017677667,branchStatus=PhaseTwo_RollbackFailed_Retryable,result code =Success,getMsg =null,channel:[id: 0xf608287b, L:/127.0.0.1:49312 - R:/127.0.0.1:8091]
以上是打印日志,其中show_name是byte型的字段,数据前后是一致的,测试就是设置了该byte型字段时会导致回滚失败。
Contributor guide
Research direction
Start by reproducing the reported rollback failure in the Seata sample with a MySQL table containing the byte field show_name, using the log's dirty-data comparison as the symptom to investigate. Done means a transaction that updates this field can roll back successfully without reporting that the old and new data differ.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, mysql
- Domain
- databases, distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100