Skip to content
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

[BUG] TiBigData's AutoRandom ID assignment implementation is inconsistent with the TiDB implementation #244

Closed
qidi1 opened this issue Sep 15, 2022 · 0 comments · Fixed by #246
Labels
type/bug Something isn't working

Comments

@qidi1
Copy link
Contributor

qidi1 commented Sep 15, 2022

Describe the bug

TiBigData's AutoRandom ID assignment implementation is inconsistent with the TiDB implementation. IDs assigned in TiBigData will be reassigned in TiDB.
What did you do

CREATE TABLE `tiflink_test`.`4015fe27517944ec8cfc3822221b2aa9`(
        id bigint unsigned PRIMARY KEY clustered AUTO_RANDOM(1), 
       number bigint
)

First , insert some row by TiBigData to table like above. Then, use mysql client to insert a row to table.

What do you expect

Successfully inserted

What happens instead

image

The bug is cause by the autorandom id's meta prefix use in TiBigData is different from TiDB.
In TiDB, autorandom id's meta prefix is "TARID" , but in TiBigData, autorandom id's meta prefix is "TID".
TiDB
5H1Yvbdii3
TiBigData
image

Flink/Presto/MapReduce/Trino/Hive and TiBigData version info
master

@qidi1 qidi1 added the type/bug Something isn't working label Sep 15, 2022
qidi1 added a commit to qidi1/TiBigData that referenced this issue Sep 19, 2022
…istent with the TiDB implementation ref:tidb-incubator#244

Signed-off-by: qidi1 <1083369179@qq.com>
xuanyu66 pushed a commit that referenced this issue Sep 22, 2022
…tation ref:#244 (#246)

## What is the purpose of the change
* close #244 

## Brief change log
* Add a new row id meta data prefix `RANDOM_ID_PREFIX`.
* Choice prefix by `RowIDAllocateType`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant