Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
expression: fix uuid generate duplicate value with multi-node #10590
What problem does this PR solve?
the question is
but has be
as result, mutiple node generate uuid maybe duplicate if they be called as same time.
What is changed and how it works?
the easiest way to fix this question is call
ps: mysql's implement https://github.com/mysql/mysql-server/blob/6b10960e9d2e606b2774143da60903d641ac542f/sql/item_strfunc.cc#L3898 also will use random nodeid when interface can not obtain too, https://dev.mysql.com/doc/refman/8.0/en/miscellaneous-functions.html#function_uuid, and uuid can be duplicate but it should be very low probability
at last, our ddl use
after this patch will got
"Breaking backward compatibility" should not be problem, V1 use timestamp and new version will add real not it should not duplicate to old generated data by old tidb.
@@ Coverage Diff @@ ## master #10590 +/- ## ================================================ - Coverage 78.3658% 78.3465% -0.0193% ================================================ Files 414 414 Lines 87704 87709 +5 ================================================ - Hits 68730 68717 -13 - Misses 13840 13852 +12 - Partials 5134 5140 +6