Bug 248070 - replicas on nfsv4 server not working as expected by the client
replicas on nfsv4 server not working as expected by the client
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: nfs-utils (Show other bugs)
5.0
All Linux
low Severity low
: ---
: ---
Assigned To: Steve Dickson
yanfu,wang
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-07-12 19:05 EDT by Shirish S. Pargaonkar
Modified: 2010-09-22 09:42 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-09-22 09:42:05 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Shirish S. Pargaonkar 2007-07-12 19:05:48 EDT
Description of problem:

replicas keyword in /etc/exports file for an nfsv4 filesystem on a server
does not  result in referrals being sent to replication server becuase there 
is  no NFS4ERR_MOVED received by the client whereas refer keyword
results in referrals being sent by the client

Version-Release number of selected component (if applicable):

nfs-utils 1.1.0
kernel 2.6.22-rc2

How reproducible:

Everytime

Steps to Reproduce:

Here is the setup, two NFS v4 servers (one RHEL5 and one SLES10) and
one NFS v4 client (RHEL5).

------------------------------------------------------------------------------
NFS server 1 RHEL5 (linux-nfs1)

kernel    2.6.22-rc2
nfs-utils 1.1.0

#cat /etc/exports
/export     *(rw,fsid=0,insecure,no_root_squash,sync,no_subtree_check)
/export/fs1 *(rw,nohide,insecure,no_root_squash,sync,no_subtree_check)
/export/fs2 *
(rw,nohide,insecure,no_root_squash,sync,no_subtree_check,refer=/fs2@cifstest6)
/export/fs3 *(rw,nohide,insecure,no_root_squash,sync,no_subtree_check)
/noacl      *(rw,subtree_check,no_root_squash,no_acl)

#/etc/init.d/idmapd start
#/etc/init.d/nfs    start


#mount
/nfsv4fs/fs1 on /export/fs1 type none (rw,bind)
/nfsv4fs/fs2 on /export/fs1 type none (rw,bind)
/nfsv4fs/fs3 on /export/fs1 type none (rw,bind)

-----------------------------------------------------------------------------

NFS server 2 SLES10  (cifstest6)

kernel      2.6.16.20-0.12-smp
nfs-utils   1.0.7-36


#cat /etc/exports
/export     *(rw,fsid=0,insecure,no_root_squash,sync,no_subtree_check)
/export/fs1 *(rw,nohide,insecure,no_root_squash,sync,no_subtree_check)
/export/fs2 *(rw,nohide,insecure,no_root_squash,sync,no_subtree_check)

#/etc/init.d/idmapd start
#/etc/init.d/nfs    start

#mount
/path/fs1 on /export/fs1 type none (rw,bind)
/path/fs2 on /export/fs1 type none (rw,bind)

-----------------------------------------------------------------------------

NFS client 1 RHEL5 (linux-nfs2)

kernel    2.6.22-rc2
nfs-utils 1.1.0

#/etc/init.d/idmapd start

#mount
linux-nfs1:/ /mnt type nfs4 (rw,addr=1.2.345.67)
cifstest6:/ /mnt2 type nfs4 (rw,addr=2.3.456.78)


-------------------------------------------------------------------------------

I noticed that with keyword refer in the /etc/exports file, client does
recieve NFS4ERR_MOVED error but with keyword replicas, it does not and
as a result, it does not ask for fs_locations attribute.

I also did three additional binds i.e. mount --bind . . in exported 
directories on the first
server and now the output of mount command looks like this (has three 
additional entries)
since there are three exported directories


#mount
/nfsv4fs/fs1 on /export/fs1 type none (rw,bind)
/nfsv4fs/fs2 on /export/fs2 type none (rw,bind)
/nfsv4fs/fs3 on /export/fs3 type none (rw,bind)
/export/fs1 on /export/fs1 type none (rw,bind)
/export/fs2 on /export/fs2 type none (rw,bind)
/export/fs3 on /export/fs3 type none (rw,bind)

as my /etc/exports is like this


#cat /etc/exports
/export     *(rw,fsid=0,insecure,no_root_squash,sync,no_subtree_check)
/export/fs1 *(rw,nohide,insecure,no_root_squash,sync,no_subtree_check)
/export/fs2 *
(rw,nohide,insecure,no_root_squash,sync,no_subtree_check,replicas=/fs2@1.2.345.
67)
/export/fs3 *
(rw,nohide,insecure,no_root_squash,sync,no_subtree_check,refer=/fs3@2.3.456.78)

yet no luck with replicas as with refer i.e. no NFS4ERR_MOVED sent by server
in case of when client does   ls /mnt/fs2

But I am wondering if with refer keyword, if client can get NFS4ERR_MOVED error
without doing "mount --bind . ." in the exported directories, should
it not be also not needed for keyword replicas in the /etc/exports entries to 
work?

There was nothing logged in file /var/log/messages before I turned on
debugging of rpc.mountd using -d all option.

These are the messages logged in /var/log/messages for command  ls /mnt/fs2
on the client (replica case which does not work)

Jul 12 13:51:30 linux-nfs1 mountd[3566]: method_list(/fs2@9.3.abc.def)
Jul 12 13:51:30 linux-nfs1 mountd[3566]: converted to /fs2@9.3.abc.def
Jul 12 13:51:30 linux-nfs1 mountd[3566]: replicas listsize=1
Jul 12 13:51:30 linux-nfs1 mountd[3566]:     9.3.abc.def:/fs2
Jul 12 13:51:30 linux-nfs1 mountd[3566]: replicas listsize=1
Jul 12 13:51:30 linux-nfs1 mountd[3566]:     9.3.abc.def:/fs2
Jul 12 13:51:30 linux-nfs1 mountd[3566]: method_list(/fs2@9.3.abc.def)
Jul 12 13:51:30 linux-nfs1 mountd[3566]: converted to /fs2@9.3.abc.def
Jul 12 13:51:30 linux-nfs1 mountd[3566]: replicas listsize=1
Jul 12 13:51:30 linux-nfs1 mountd[3566]:     9.3.abc.def:/fs2
Jul 12 13:51:30 linux-nfs1 mountd[3566]: replicas listsize=1
Jul 12 13:51:30 linux-nfs1 mountd[3566]:     9.3.abc.def:/fs2

These are the messages logged in /var/log/messages for command  ls /mnt/fs3
on the client (refer case which does work)

Jul 12 13:54:04 linux-nfs1 mountd[3566]: method_list(/fs1@9.3.abc.def)
Jul 12 13:54:04 linux-nfs1 mountd[3566]: converted to /fs1@9.3.abc.def
Jul 12 13:54:04 linux-nfs1 mountd[3566]: replicas listsize=1
Jul 12 13:54:04 linux-nfs1 mountd[3566]:     9.3.abc.def:/fs1
Jul 12 13:54:04 linux-nfs1 mountd[3566]: replicas listsize=1
Jul 12 13:54:04 linux-nfs1 mountd[3566]:     9.3.abc.def:/fs1  

Actual results:

A command such as ls /mnt/fs2 on the client ends up displaying the directory
listings on the original server.

Expected results:

The above command, ls /mnt/fs2 on the the client should display the directory
listings under /export/fs2 of the replication server.

Additional info:
Comment 1 Edouard Bourguignon 2009-04-14 05:40:20 EDT
Hello,

any news on this bug??
Comment 2 Steve Dickson 2010-09-20 09:28:35 EDT
Try replacing the 'refer=/fs2@cifstest6' with  'refer=/fs2@<ip address>'
and make sure bind mounts are done on the exports, ala
    mount --bind /export/fs2 /export/fs2
Comment 3 J. Bruce Fields 2010-09-20 10:39:47 EDT
"replicas keyword in /etc/exports file for an nfsv4 filesystem on a server
does not  result in referrals being sent to replication server becuase there 
is  no NFS4ERR_MOVED received by the client whereas refer keyword
results in referrals being sent by the client"

The described behavior is correct; use of the "replicas" keyword should not result in NFS4ERR_MOVED being sent to the client.  Replicas are meant to inform the client of alternate locations from which the client may access the same data, not to force the client to use one of those locations.  Whether the client  chooses to query fs_locations, and use one of those alternate locations, is up to the client.  The current Linux client will not do so.
Comment 4 Steve Dickson 2010-09-22 09:42:05 EDT
So since this is the expected behaviour I'm going to close this 
bug as NOTABUG... Please feel free to reopen....

Note You need to log in before you can comment on or make changes to this bug.