-
Notifications
You must be signed in to change notification settings - Fork 420
Open
Description
static inline int64_t CalcTurnBackId(SnowFlakeWorker *worker) {
uint64_t result = (worker->_LastTimeTick << worker->_TimestampShift) | (worker->WorkerId << worker->SeqBitLength) |
(worker->_TurnBackIndex);
worker->_TurnBackTimeTick--;
return result;
}
时间戳部分应该是使用worker->_TurnBackTimeTick进行计算吧,master分支目前是使用worker->_LastTimeTick. 应修改为以下:
static inline int64_t CalcTurnBackId(SnowFlakeWorker *worker) {
uint64_t result = (worker->_TurnBackTimeTick << worker->_TimestampShift) | (worker->WorkerId << worker->SeqBitLength) |
(worker->_TurnBackIndex);
worker->_TurnBackTimeTick--;
return result;
}
Metadata
Metadata
Assignees
Labels
No labels