codingapi / codingapi/tx-lcn

springboot2.1.3+mysql5.7集成tx-lcn 5.0.2.RELEASE事务总是导致mysql事务没提交和回滚,导致锁表

Aperta
#480 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Java
Stelle
4.2k
Fork
1.4k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

1.项目采用的springboot2.1.3+springcloud Greenwich.RELEASE+mysql 5.7
2.tx-manager是自己参照官方说明实现的,tx-manager能接收到tc端的注册和事务组创建;
PS:之前事务组超时时间设置的是8秒,事务组经常出现超时,后来设置成80秒,事务组不超时了;
3. tc端springboot启动类增加了@EnableDistributedTransaction和@EnableTransactionManagement两个注解
4.tc端使用方式有两种:
1)分布式事务发起者和参与者都采用@LcnTransaction注解不加任何参数
2)分布式事务发起者采用@LcnTransaction注解不加任何参数,参与者@LcnTransaction注解加入propagation = DTXPropagation.SUPPORTS参数
PS:以上这两种方式都试过,都是一样到导致锁表,而且出现过表级锁;
5.每次业务执行完成后查询mysql锁情况,发现数据库连接都没有释放;
6.目前现状:
不管事务正常执行还是事务组超时,事务都不提交和回滚,下次执行业务就会导致数据库表锁等待。
PS:事务执行完和超时后redis中事务组会自动消失;

请问为什么tc客户端事务已经执行完了,事务组不提交和回滚事务呢?

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Start with the tc application's Spring Boot startup class and its @EnableDistributedTransaction and @EnableTransactionManagement configuration, then review the tx-manager and tc transaction flow described in the report. Reproduce both @LcnTransaction variants and inspect MySQL locks and unreleased connections after completion and timeout; done means transactions commit or roll back and connections are released without subsequent lock waits.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java, mysql, spring-boot
Ambito
backend, databases, distributed-systems
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.