Red Hat Bugzilla – Bug 1063087
nfsd magically changes /proc/fs/nfsd/nfsv4gracetime
Last modified: 2017-03-17 07:36:59 EDT
After some debugging of a nfs cluster setup i discovered that nfsd seems to mess secretly with the /proc/fs/nfsd/nfsv4gracetime value. If the nfsv4leasetime is larger than nfsv4gracetime then after a few seconds the daemon seem to automatically set the gracetime to the value of the leasetime. It does this without printing a warning to the logs or informing the admin of the system. While the behaviour makes sense given the meaning of these variables the magic way nfsd handles this makes debugging of gracetime issues a nightmare. This also effectively breaks the NFSD_V4_GRACE variable in /etc/sysconfig/nfs. I see too solutions here: 1) Since nfsd insists on gracetime >= leasetime an attempt to set gracetime to anything lower than the leasetime should result in an immediate error. This way the constraints are enforced in a better way (the current approach is racy) and there is no magical behaviour anymore making the admins life easier. 2) If the above is not possible for some reason then nfsd should at least print an warning to the syslog that it adjusted the value. That way the admin at least knows what is going on and does not have to go on a quest t find out who/what keeps resetting the gracetime. I noticed this on a CentOS 6.5 system.
Yes, this was a stupid idea on my part, apologies, recently fixed. Maybe we should backport the following. commit bea57fe45ba2 Author: J. Bruce Fields <bfields@redhat.com> Date: Mon Sep 15 11:05:46 2014 -0400 nfsd4: stop grace_time update at end of grace period The attempt to automatically set a new grace period time at the end of the grace period isn't really helpful. We'll probably shut down and reboot before we actually make use of the new grace period time anyway. So may as well leave it up to the init system to get this right. This just confuses people when they see /proc/fs/nfsd/nfsv4gracetime change from what they set it to. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
That said, that's mainly a cosmetic change, the enforced grace period should still be what you asked for, so I'm a little concerned to hear you say "This also effectively breaks the NFSD_V4_GRACE variable in /etc/sysconfig/nfs." Steved, does 6.5 have the logic that uses NFSD_V4_GRACE to set the nlm grace period too?
(In reply to J. Bruce Fields from comment #4) > That said, that's mainly a cosmetic change, the enforced grace period should > still be what you asked for, so I'm a little concerned to hear you say "This > also effectively breaks the NFSD_V4_GRACE variable in /etc/sysconfig/nfs." > > Steved, does 6.5 have the logic that uses NFSD_V4_GRACE to set the nlm grace > period too? Yes it does... but it only sets nfsv4gracetime not nfsv4leasetime. That was fixed in RHEL6.6 with the fix to bz1058354
(In reply to Steve Dickson from comment #5) > (In reply to J. Bruce Fields from comment #4) > > That said, that's mainly a cosmetic change, the enforced grace period should > > still be what you asked for, so I'm a little concerned to hear you say "This > > also effectively breaks the NFSD_V4_GRACE variable in /etc/sysconfig/nfs." > > > > Steved, does 6.5 have the logic that uses NFSD_V4_GRACE to set the nlm grace > > period too? > Yes it does... but it only sets nfsv4gracetime not nfsv4leasetime. > That was fixed in RHEL6.6 with the fix to bz1058354 This seems to be fixed... closing the bz.
Removing from the 68FileAndStorageRPL.