Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

有个非常严重的Bug #10

Closed
westonlv opened this issue Aug 22, 2019 · 1 comment
Closed

有个非常严重的Bug #10

westonlv opened this issue Aug 22, 2019 · 1 comment

Comments

@westonlv
Copy link

在动态数据源DynamicDataSource类中determineCurrentLookupKey,每次都是随机选择真实的DataSource,但是在DbSegmentIdServiceImpl.getNextSegmentId方法中使用了乐观锁,每获取一个SegmentInfo都存在query 以及 update 数据的动作,所以query和update可能操作的不是同一张表

@duimba
Copy link
Collaborator

duimba commented Aug 22, 2019

在动态数据源DynamicDataSource类中determineCurrentLookupKey,每次都是随机选择真实的DataSource,但是在DbSegmentIdServiceImpl.getNextSegmentId方法中使用了乐观锁,每获取一个SegmentInfo都存在query 以及 update 数据的动作,所以query和update可能操作的不是同一张表

这的确是一个严重的bug......
已经修复,通过在DbSegmentIdServiceImpl.getNextSegmentId方法上增加了@transactional标记,保证了同一connection
同时修改了dao层的update方法,增加了biz_type判定,以防意外

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants