Comments (1)
在动态数据源DynamicDataSource类中determineCurrentLookupKey,每次都是随机选择真实的DataSource,但是在DbSegmentIdServiceImpl.getNextSegmentId方法中使用了乐观锁,每获取一个SegmentInfo都存在query 以及 update 数据的动作,所以query和update可能操作的不是同一张表
这的确是一个严重的bug......
已经修复,通过在DbSegmentIdServiceImpl.getNextSegmentId方法上增加了@transactional标记,保证了同一connection
同时修改了dao层的update方法,增加了biz_type判定,以防意外
from tinyid.
Related Issues (20)
- 多库情况下可以将多库自动的实现为主备库互换逻辑 HOT 2
- 和tddl-sequence的对比?
- 单例存在并发问题
- snowflake 没有实现吗?
- 在 maven 的**仓库中还搜不到 jar 包坐标 HOT 2
- 能否增加动态step调整,让segment分配的频率更加可控 HOT 2
- tiny_id_info 表的id应该用bigint, 而不需要带unsigned. bigint(20) unsigned 对应Long时会有越界错误.
- 在调用 nextIdSimple 获取id时,batchSize = 0 时会出现越界 HOT 1
- 请教个关于代码中单利初始化问题 HOT 1
- 可以提供一个 便于springboot 切换环境的版本么 HOT 1
- 如果业务方服务宕机了,那么已经获取到本地
- tinyid是否支持部署到K8S容器内呢?
- 生成器提前初始化提高首次访问性能
- tiny client 模式(有本地缓存),怎么解决个多个应用实例同时生产id,不重复问题? HOT 1
- There is a vulnerability in mysql-connector-java 5.1.44 ,upgrade recommended
- There is a vulnerability in commons-beanutils 1.9.3,upgrade recommended
- Tinyid-Server查询db最新号段的事务使用方式存在疑问 HOT 1
- 如果有一台tinyserver挂掉, tinyclient的router不是会出问题吗?
- 这个ID生成器,已经长期没人维护了,只能说能用,要用最好fork改一份
- version这个字段有意义吗? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tinyid.