多台服务器的时候生成的 ID 会重复。
Open
- Dominant language
- Java
- Stars
- 5.6k
- Forks
- 1.5k
- PR merge metrics
- No merged PRs in 30d
Description
1. 写一个测试接口。
2. 访问接口生成 1000 个 ID,然后保存到数据库,ID 作为主键。
3. 同样的服务启动 2 个,使用 Nginx 做负载均衡。
4. 不停的访问这个接口,然后就会看到提示主键冲突: Duplicate entry '1508919604150272' for key 'test_id.PRIMARY'
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the test interface described in the issue and reproduce the failure by running two service instances behind Nginx, generating 1,000 IDs per request, and saving them with the ID as the primary key. Then trace the ID-generation path and compare outputs from both instances. Done means repeated traffic no longer produces duplicate primary-key values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, nginx
- Domain
- backend, distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100