-
Notifications
You must be signed in to change notification settings - Fork 178
Conversation
The hostid call was added a long time ago at SVN commit f23e92f. Does anybody know if there was a reason for doing it this way over any other?
I recommend leaving the
Fedora 17 plumbs |
The purpose of the hostid check is to prevent conflicting access into shared storage by cluster nodes, which is an uncommon configuration, or to prevent things like accidental SAN imports. This pull request got me thinking that:
Would either of these two things be acceptable alternatives?
|
Two reasons:
However, these days I'm much less attached to doing things the OpenSolaris way particularly if there's a more Linux friendly approach which achieves the same thing.
Perhaps, the only thing required of this value is that it be 1) persistent, 2) unique (usually) 3) available early in the boot process, and 4) accessible from within the kernel. The hostname should cover 1) and 2) as long as we avoid the per-process namespaces. But I don't believe we're guaranteed the hostname is set early in boot process. And as for 4) Perhaps there's something else we could use?
This I find more appealing. As you mentioned above in practice the amount of protection we're getting from this is minimal for many end user configurations. We could disable it by default and force installations which are running in a shared storage environment to manually enable it. By doing so we'd be no worse off than all of the other existing Linux filesystems which have no such protection. Longer term we'll be replacing the hostid functionality with proper MMP protection anyway which is described in #745. |
Plenty decade ago on Solaris Sparc with sol 9 and bevor, Same thing with Ether mac used are used almost on UniX hardware and Software like systems. MAC addresses can changed on modern cards today using firmware tools. So my assumtion is to use the MAC of the eth0 i.e as hostaddess to have an Uniq ID for the zpool/ZIl ... Even due some due some LinuX Disto Concepts ( i.e Fc ) of implementing Network, hope this helps. |
There is plenty of compatibility code for a hw_hostid that isn't used by anything. At the same time, there are apparently issues with the current hostid logic. coredumb in #zfsonlinux on freenode reported that Fedora 17 changes its hostid on every boot, which required force importing his pool. A suggestion by wca was to adopt FreeBSD's behavior, where it treats hostid as zero if /etc/hostid does not exist Adopting FreeBSD's behavior permits us to eliminate plenty of code, including a userland helper that invokes the system's hostid as a fallback. Signed-off-by: Richard Yao <[email protected]>
I have refreshed the patch based on feedback over the past year. It is almost exactly what I had been using in Gentoo, except I no longer mask off the top 4-bits to match Solaris. |
@dajhorn The amount of suffering caused by this hostid nonsense has me leaning towards picking up this change. Or if not exactly this change then just making the proposed behavior in the patch the default with a module option to re-enable the previous behavior. But before doing that I wanted to check if that will cause you issues. |
@behlendorf, nope. Moving towards hostid retirement is good for ZoL. |
There is plenty of compatibility code for a hw_hostid
that isn't used by anything. At the same time, there are apparently
issues with the current hostid logic. coredumb in #zfsonlinux on
freenode reported that Fedora 17 changes its hostid on every boot, which
required force importing his pool. A suggestion by wca was to adopt
FreeBSD's behavior, where it treats hostid as zero if /etc/hostid does
not exist
Adopting FreeBSD's behavior permits us to eliminate plenty of code,
including a userland helper that invokes the system's hostid as a
fallback.
Signed-off-by: Richard Yao [email protected]