-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
Bugfix: UUIDGenerator generates duplicated id #2972
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #2972 +/- ##
=============================================
+ Coverage 50.10% 50.21% +0.11%
Complexity 3053 3053
=============================================
Files 599 599
Lines 19438 19463 +25
Branches 2351 2396 +45
=============================================
+ Hits 9739 9774 +35
- Misses 8692 8704 +12
+ Partials 1007 985 -22 |
} else { | ||
sequence = 0L; | ||
if (lastTimestamp == timestamp) { | ||
sequence = (sequence + 1) & sequenceMask; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the sequence is different, why cause the duplicated id?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my fault.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Ⅰ. Describe what this PR did
UUIDGenerator类的generateUUID()方法在高并发情况下,会生成重复的id
Ⅱ. Does this pull request fix one issue?
高并发压测发现
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
高并发压测,不会再出现重复的branchid
Ⅴ. Special notes for reviews
UUIDGenerator generate duplicated id