[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#595790: [Pkg-zfsonlinux-devel] Bug#595790: hostid: useless unless fixed



[Florian Weimer]
> That's not very different from /etc/machine-id, isn't it?

Ah, thank you very much for bringing this systemd setting to my
attention.  I was not aware of it.

I agree that it seem very similar in purpose and implementation.  Will
it be available on non-linux Debian architectures too?

>> We need to figure out how to transform the UUID to a 32 bit integer,
>> of course.
>
> And I think this is the crux of the problem.  Whatever we do, with
> today's cluster sizes it's just not reliably unique.

Well, for the set of machines we have available at work (ca. 3000) it
would be sufficiently unique.  For most sites it would make the return
value from gethostid() unique.  In most use cases it do not need need to
globally unique.  Like the ZFS use case, it just need to be unique among
the hosts sharing the storage system.

In another use case at work, it should be unique across the entire stock
of linux machines.

> You could use /etc/machine-id instead.  Some effort goes into that to
> make it actually unique.

I will definitely put this systemd value in my tool box.  Again, thank
you very much for mentioning it. :)

> DMI data seems risky because it depends on firmware, and there are so
> many firmware bugs out there.

I did not quite understand what you mean here.  Do you mean the DMI
value in your experience isn't unique?

> It would also not address the matter of changing host IDs as the
> result of host migrations.

As far as I can tell, host migration could be solved by storing the
wanted hostid in /etc/hostid when migrating.

On an related note, I had a look at the POSIX definition for
gethostuid()[1], and its "Upon successful completion, gethostid() shall
return an identifier for the current host" is definitely very vague.  So
glibc is sure not violating POSIX by changing the value when the host
changes IP address or commonly returning identical IDs on different
machines, but real world applications on the other hand expect the
hostid value to be reasonably unique and fixed across IP changes and
reboots.

 [1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/gethostid.html

-- 
Happy hacking
Petter Reinholdtsen


Reply to: