-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Segment auto-increasing id #3550
Conversation
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.
Maybe need to consider a method to control the segment size .
Please ignore my approval, I ordered it wrong |
00127de
to
31c6b8a
Compare
@@ -25,6 +26,8 @@ void UUIDExpression::resetFrom(Decoder& decoder) { | |||
|
|||
const Value& UUIDExpression::eval(ExpressionContext& ctx) { | |||
UNUSED(ctx); | |||
SegmentId& generator = SegmentId::getInstance(10000); |
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.
TODO: need to do multiple instance of segment id and snowflake id
src/common/id/SegmentId.h
Outdated
|
||
private: | ||
explicit SegmentId(int64_t step) : step_(step) { | ||
segmentStart_ = fetchSegment(); | ||
auto xRet = fetchSegment(); |
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.
xRet may not be ok, so you need to move this logic to a init() func.
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.
Ignore my approval...
ef7e3b0
to
f50c986
Compare
03d826a
to
88afdda
Compare
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.
It's not a good practice that id generator depends on meta client directly.
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
What type of PR is this?
What does this PR do?
Which issue(s)/PR(s) this PR relates to?
close #3448
Special notes for your reviewer, ex. impact of this fix, etc:
Additional context:
Checklist:
Release notes:
Please confirm whether to reflect in release notes and how to describe: