Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Aug 2022 15:41:16 +0000
From:      Rick Macklem <rmacklem@uoguelph.ca>
To:        Ronald Klop <ronald-lists@klop.ws>, Pete French <pete@twisted.org.uk>, "stable@freebsd.org" <stable@freebsd.org>
Subject:   Re: double used hostuuids - Re: NFS issue - newnfs_request: Wrong session srvslot=1 slot=0, freeing free slot!!
Message-ID:  <YT2PR01MB9729E5FF773D5EE44D03417BDD779@YT2PR01MB9729.CANPRD01.PROD.OUTLOOK.COM>
In-Reply-To: <817221085.13327.1661677440487@localhost>
References:  <0bfcccf8-1a40-326a-912a-734f97dffe4f@twisted.org.uk> <817221085.13327.1661677440487@localhost>

next in thread | previous in thread | raw e-mail | index | archive | help
Ronald Klop wrote:=0A=
> Van: Pete French <pete@twisted.org.uk>=0A=
> Datum: 28 augustus 2022 10:16=0A=
> Aan: stable@freebsd.org=0A=
> Onderwerp: Re: double used hostuuids - Re: NFS issue - newnfs_request: Wr=
ong session srvslot=3D1 slot=3D0, freeing free slot!!=0A=
> =0A=
> On 27/08/2022 16:18, Rick Macklem wrote:=0A=
> > Ronald Klop <ronald-lists@klop.ws> wrote:=0A=
> >> On 8/27/22 00:17, Rick Macklem wrote:=0A=
> >>> Ganbold Tsagaankhuu <ganbold@gmail.com> wrote:=0A=
> >>>>> Rick,=0A=
> >>>>>=0A=
> >>>>> On Fri, Aug 26, 2022 at 11:18 AM Rick Macklem > ><rmacklem@uoguelph=
.ca<mailto:rmacklem@uoguelph.ca>> wrote:=0A=
> >>> Ganbold Tsagaankhuu <ganbold@gmail.com<mailto:ganbold@gmail.com>> wro=
te:=0A=
> >>>>>> Hi,=0A=
> >>>>>>=0A=
> >>>>>> We are having trouble with NFS running on STABLE:=0A=
> >>>>>>=0A=
> >>>>>> Aug 26 02:21:42 iron2 kernel: newnfs_request: Wrong session srvslo=
t=3D1 slot=3D0=0A=
> >>> [stuff snipped]=0A=
> >>>>>> Aug 26 02:22:46 iron2 kernel: newnfs_request: Wrong session srvslo=
t=3D1 slot=3D0=0A=
> >>>>>> Aug 26 02:22:46 iron2 kernel: freeing free slot!!=0A=
> >>>>>>=0A=
> >>>>>> We are running FreeBSD 13.1-STABLE #3 stable/13-n252198-c1434fd2de=
a: Fri Aug 26 01:51:53 UTC 2022 and mount options are:=0A=
> >>>>>>=0A=
> >>>>>> rw,nfsv4,minorversion=3D1,bg,soft,timeo=3D20,retrans=3D5,retrycnt=
=3D5=0A=
> >>>>>> ro,nfsv4,minorversion=3D1,bg,soft,timeo=3D20,retrans=3D5,retrycnt=
=3D5=0A=
> >>>>>>=0A=
> >>>>>> Is there any fix for this issue?=0A=
> >>> Oh, and one more thing. If you have multiple clients mounting the=0A=
> >>> NFSv4 server, make sure they all have unique hostids.=0A=
> >>> Check /etc/hostid and "sysctl kern.hostuuid". If two clients have the=
=0A=
> >>> same kern.hostuuid, there will be lots of trouble.=0A=
> >>>=0A=
> >>> rick=0A=
> >>=0A=
> >> Just a thought. Is it possible/easy to warn about double used hostuuid=
s >from different client IP addresses?=0A=
> >> Although that will not help this person using Netapp as a server.=0A=
> > I don't think so. Same hostuuid implies same system, so how does a=0A=
> > server know they are two different systems?=0A=
> > - A client could have multiple IP host addresses, so different client=
=0A=
> >    host IP addresses for a TCP connection does not imply different syst=
ems.=0A=
> >=0A=
> > I can, however, modify the console message the server generates when=0A=
> > it sees a session has been replaced to include "check clients have=0A=
> > unique hostuuids", which might help.=0A=
> >=0A=
> > I also plan on adding a sentence to "man mount_nfs" about this,=0A=
> > since I just had an email discussion with someone else where the=0A=
> > problem turned out to be "same hostuuids for multiple clients"=0A=
> > and the loss of sessions on the FreeBSD server was the hint that=0A=
> > clued me in.=0A=
> >=0A=
> > At least I now know this configuration issue exists.=0A=
> >=0A=
> > rick=0A=
> >=0A=
> > Regards,=0A=
> > Ronald.=0A=
> >=0A=
> =0A=
> It well worth adding this I think. I didnt realise this about NFSv4, and =
I do a lot with cloud machines, where I > simply clone the discs, and thus =
ended up with many machines with the same hostid. Took me a while to=0A=
> work out why my NFS was havign issues...=0A=
I have already committed a change for the server console message to main an=
d it will be MFC'd=0A=
in a couple of weeks.=0A=
=0A=
I will do a man page update soon, as well.=0A=
=0A=
> -pete.=0A=
=0A=
> It might help this case if the nfs client combined hostid+ip as a client =
id. Or include mac address. People=0A=
> tend to change the mac after a clone.=0A=
Well, in the past I have thought about this...=0A=
The problem is that, ideally, the string used by the NFSv4 client mount sho=
uld be=0A=
invariant over time (including client reboot cycles).=0A=
Depending upon the situation, a machine's IP addresses can change over time=
 (dynamically=0A=
assigned via dhcp, for example). They can also end up as addresses like 192=
.168.1.n sitting=0A=
behind a nat gateway, where the IP could be duplicated on other subnets.=0A=
As for MAC, if it is taken from a hardware card, then that hardware card ge=
ts replaced,=0A=
the MAC changes.=0A=
=0A=
I think /etc/hostid (or whatever is used to set "kern.hostuuid") seems the =
best bet=0A=
for something unique that remains invariant for the life of the system.=0A=
I think all cloners need to do is remove /etc/hostid from the master being=
=0A=
cloned and then each clone will generate their own /etc/hostid upon first b=
oot.=0A=
=0A=
rick=0A=
=0A=
Regards,=0A=
Ronald=0A=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YT2PR01MB9729E5FF773D5EE44D03417BDD779>