[MDEV-23748] support not-MAC-address based UUID versions Created: 2020-09-17 Updated: 2023-10-31 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Server |
| Fix Version/s: | None |
| Type: | Task | Priority: | Minor |
| Reporter: | Jonathan Shapiro | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | beginner-friendly | ||
| Issue Links: |
|
||||||||||||||||||||
| Description |
|
So far as I know, this affects all versions of MariaDB. On Linux, FreeBSD, and (perhaps) MacOS, MariaDB uses the host MAC address as the basis for generating v1 UUID values in the UUID() function. On Windows, it generates a random nonce and uses that instead of a MAC address. In cloud or virtual machine deployments, it is likely that
On Windows deployments this has not been an issue, because these deployments generate random nonces instead of using the MAC address. It would be helpful if it were possible to configure the Linux/FreeBSD/?Mac installations to use such a nonce in environments where the uniqueness of the MAC address is uncertain or unreliable. Since the nonce support code is already present, one might hope this would not be a big lift. |
| Comments |
| Comment by Vladislav Vaintroub [ 2020-09-17 ] |
|
shap, "On Windows, it generates a random nonce and uses that instead of a MAC address." |
| Comment by Sergei Golubchik [ 2020-09-18 ] |
|
v1 UUID must use the mac address. So this is, basically, a (valid) request to implement UUID version 3, 4, or 5. |
| Comment by Trevor Gross [ 2022-01-21 ] |
|
Keeping UUID() to be a UUIDv1 generator based on mac address seems necessary for MySQL compatibility. As a random user, I'd vouch for implementing UUID generation functions the way that the postgres plugin does it https://www.postgresql.org/docs/13/uuid-ossp.html
In my opinion, uuid_generate_v4 and uuid_generate_v1mc would be the most useful to have. The mc version with the mac saved to a variable would nicely address circumstances where generating node needs to be tracked (so v4 isn't usable), but tracked to the database instance rather than the server it runs on. |