baidu / baidu/uid-generator

为啥不把delta seconds和worker id换个位置?

Open
#85 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
5.6k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

CachedUidGenerator有可能使用未来到时间,(对于单个实例应用来说)当服务立刻重启后,worker id+1,但是开始时间有可能回到上次的最大时间之前,导致生产的Uid不是单调递增的

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading CachedUidGenerator and its handling of delta seconds, worker ID, and restart state. Reproduce the immediate-restart scenario described in the issue and inspect whether generated UIDs can move backward. Done means the proposed layout change is evaluated and the generator preserves monotonic ordering for a single instance after restart.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
distributed-systems
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.