2022-07-06 12:41:07

by jie wang

[permalink] [raw]
Subject: Question abount sm-notify when use NFSv3 lock

Hi, all
When we use NFSv3, we have a LoadBalance in front of NFS server. For
example, LoadBalance's ip is ip2 and NFS server's ip is ip1, and
client use ip2 to mount.

Now client use flock to lock file, then I restart NFS server and
execute sm-notify -f. Then the problem occurs, the sm-notify request's
src ip is ip1, not ip2, so rpc.statd will ignore this notify, because
it does not match ip2 when mount, so client will not reclaim lock, and
lock lost when restart NFS server.

Do you know how to address this ? Thanks a lot.


2022-07-06 14:41:28

by Benjamin Coddington

[permalink] [raw]
Subject: Re: Question abount sm-notify when use NFSv3 lock

On 6 Jul 2022, at 8:28, jie wang wrote:

> Hi, all
> When we use NFSv3, we have a LoadBalance in front of NFS server. For
> example, LoadBalance's ip is ip2 and NFS server's ip is ip1, and
> client use ip2 to mount.
>
> Now client use flock to lock file, then I restart NFS server and
> execute sm-notify -f. Then the problem occurs, the sm-notify request's
> src ip is ip1, not ip2, so rpc.statd will ignore this notify, because
> it does not match ip2 when mount, so client will not reclaim lock, and
> lock lost when restart NFS server.
>
> Do you know how to address this ? Thanks a lot.

The sm-notify(8) man page shows you can use '-v' to specify an ipaddr or
hostname.

Ben

2022-07-07 00:03:22

by jie wang

[permalink] [raw]
Subject: Re: Question abount sm-notify when use NFSv3 lock

Thanks the reply, I have tried it, but it doesn't work, '-v' can only
use the local address


On Wed, Jul 6, 2022 at 10:39 PM Benjamin Coddington <[email protected]> wrote:
>
> On 6 Jul 2022, at 8:28, jie wang wrote:
>
> > Hi, all
> > When we use NFSv3, we have a LoadBalance in front of NFS server. For
> > example, LoadBalance's ip is ip2 and NFS server's ip is ip1, and
> > client use ip2 to mount.
> >
> > Now client use flock to lock file, then I restart NFS server and
> > execute sm-notify -f. Then the problem occurs, the sm-notify request's
> > src ip is ip1, not ip2, so rpc.statd will ignore this notify, because
> > it does not match ip2 when mount, so client will not reclaim lock, and
> > lock lost when restart NFS server.
> >
> > Do you know how to address this ? Thanks a lot.
>
> The sm-notify(8) man page shows you can use '-v' to specify an ipaddr or
> hostname.
>
> Ben
>

2022-07-07 11:54:05

by Benjamin Coddington

[permalink] [raw]
Subject: Re: Question abount sm-notify when use NFSv3 lock

On 6 Jul 2022, at 19:57, jie wang wrote:

> If execute "sm-notify -f -v ip2", sm-notify did not send the notify
> request.

Hmm, maybe its a bug? You can turn up debugging with the "-d" opt,
adding
more increases vebosity. Try using three of them:

sm-notify -ddd -f -v ip2

Have you tried looking at an strace? Are there different values set for
sm-notify in your nfs.conf file?

Check out the source, perhaps sm-notify isn't going to be able to send a
notification for an address that doesn't exist on a local network
adapter
(this is a common pattern), and you need to configure that ip address as
an
additional address on your system?

These are guesses.

Ben