pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: byavuz81@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17358: While using --with-uuid=bsd option, uuid_ossp test fails on NetBSD 9.2
Date: Sat, 8 Jan 2022 12:45:28 -0800
Message-ID: <20220108204528.f7viwyuxamdm2n34@alap3.anarazel.de> (raw)
In-Reply-To: <1584605.1641674133@sss.pgh.pa.us>
References: <17358-89806e7420797025@postgresql.org>
	<1377833.1641588532@sss.pgh.pa.us>
	<20220108194454.kl477tb6km6tyj5r@alap3.anarazel.de>
	<1581508.1641671996@sss.pgh.pa.us>
	<20220108200643.2ufdoxj5gdfvrrdg@alap3.anarazel.de>
	<1584605.1641674133@sss.pgh.pa.us>

Hi,

On 2022-01-08 15:35:33 -0500, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
> > On 2022-01-08 14:59:56 -0500, Tom Lane wrote:
> >> Right, I was planning to have a look at how they'd done it.  The BSD
> >> implementation seems to be inside the kernel, so that's not likely
> >> to be helpful, but the other two must be in userspace.
>
> > https://github.com/tytso/e2fsprogs/blob/master/lib/uuid/gen_uuid.c#L240
> > https://github.com/sean-/ossp-uuid/blob/master/uuid_mac.c#L92
>
> Thanks for the pointers!  I was hoping for a Windows version, but
> neither one seems to cover that.

e2fs does have something, in a separate file:
https://github.com/tytso/e2fsprogs/blob/master/lib/uuid/gen_uuid_nt.c

but it looks pretty ugly. But it seems like it'd not be too hard to just use
UuidCreateSequential() or UuidCreate() on windows.

https://docs.microsoft.com/en-us/windows/win32/api/rpcdce/nf-rpcdce-uuidcreate


> Before I start writing code, there seem to be two possible approaches
> here:
>
> 1. Rip out all the external-library dependencies, lock stock and
> barrel.  contrib/uuid-ossp is always built.  --with-uuid configure
> argument becomes a no-op or an error.
>
> 2. contrib/uuid-ossp is always built, but if you say --with-uuid
> then the existing code for that library is used.  We fall back to
> homegrown code if you didn't say --with-uuid.
>
> The main argument for #2 would be to preserve bug compatibility with
> the existing behavior, in case (say) we pick a different interface's
> MAC address than you got before.  I suppose also it's possible that
> the existing libraries try harder to avoid collisions across UUIDs
> generated in different processes than I envision doing in our own
> version.
>
> Whether these are good enough reasons to continue carrying all
> that code is unclear to me.  Thoughts?

I'm inclined to think that we shouldn't carry that much code just for some
pretty tenuous backward compatibility reasons.

I wonder if we shouldn't just move all the uuid stuff to core, and make
uuid-ossp be an empty shell for a few releases. It's already pretty
confusingly named, with awkward quoting etc. In a few years it'll be
completely unintelligible.


> (I think v1 UUID uniqueness is snake-oil anyway, so I'm just thinking of
> choosing a random "clock sequence" in each process and calling it good.)

Hm. Not so sure about that... If we go there, why don't we just rip out the
ability to create v1 UUIDs?

Greetings,

Andres Freund





view thread (13+ messages)  latest in thread

Message-ID: <20220108204528.f7viwyuxamdm2n34@alap3.anarazel.de>
Permalink:  ../20220108204528.f7viwyuxamdm2n34@alap3.anarazel.de/
Also on:    postgresql.org/message-id/20220108204528.f7viwyuxamdm2n34@alap3.anarazel.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: andres@anarazel.de, tgl@sss.pgh.pa.us, byavuz81@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #17358: While using --with-uuid=bsd option, uuid_ossp test fails on NetBSD 9.2
  In-Reply-To: <20220108204528.f7viwyuxamdm2n34@alap3.anarazel.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox