Bug 1817756

Summary: Userspace support for the latest nfsdcld daemon
Product: Red Hat Enterprise Linux 8 Reporter: Scott Mayhew <smayhew>
Component: nfs-utilsAssignee: Steve Dickson <steved>
Status: CLOSED ERRATA QA Contact: Yongcheng Yang <yoyang>
Severity: unspecified Docs Contact: Katerina Nemcova <knemcova>
Priority: medium    
Version: 8.3CC: anikandr, gcase, knemcova, lmanasko, pasik, steved, swhiteho, xzhou
Target Milestone: rcKeywords: FutureFeature
Target Release: 8.3Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: nfs-utils-2.3.3-32.el8 Doc Type: Enhancement
Doc Text:
.Userspace now supports the latest `nfsdcld` daemon Userspace now supports the lastest `nfsdcld` daemon, which is the only namespace-aware client tracking method. This enhancement ensures client open or lock recovery from the containerized `knfsd` daemon without any data corruption.
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-04 01:57:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1817752    

Description Scott Mayhew 2020-03-26 22:01:28 UTC
In order to support client open/lock recovery from containerized knfsd's, we need to add support for the latest nfsdcld daemon, because the other client tracking methods (legacy i.e. "/var/lib/nfs/v4recovery" filesystem, usermodehelper i.e. "/usr/sbin/nfsdcltrack") are not namespace-aware.

The following upstream patches are needed:

15301b3 Revert "nfsdcltrack: remove the nfsdcld daemon"
3a61dd2 nfsdcld: move nfsdcld to its own directory
4ccde2a nfsdcld: a few enhancements
c2b303c nfsdcld: remove some unused functions
a8ce6c3 nfsdcld: the -p option should specify the rpc_pipefs mountpoint
86df1f0 nfsdcld: add /etc/nfs.conf support
9e4bfb6 systemd: add a unit file for nfsdcld
c0cdf77 nfsdcld: add a facility for migrating from older client tracking methods
a8133e1 sqlite.c: Use PRIx64 macro to print 64-bit integers
f6b9569 sqlite.c: restore zero-padding to the recovery table names
d728478 sqlite.c: Add a simple database health check
1270002 nfsdcld: add missing include for PATH_MAX
c5b5374 Add printf format checking
6ed3e37 nfsdcld: add a "GetVersion" upcall
51721ba nfsdcld: add support for upcall version 2
debd88f Add a tool for manipulating the nfsdcld sqlite database schema.
2159ddf nfsdcld: update nfsdcld.man
1378280 Ensure consistent struct stat definition
a20dbec nfsdcld: Fix printf format strings on 32bit
5392163 nfsdcld: don't override sbindir
56a7f1e systemd: install nfsdcld.service when nfsdcld is enabled
dc50aaf nfsdcld: getopt_long() returns an int, not a char

This bug is related to kernel bug 1817752.

Comment 11 Yongcheng Yang 2020-06-03 03:28:05 UTC
The nfsdcld tool works as expected from my testing.

(I'll open new bugs to track the issues of comment #6 later)

https://beaker.engineering.redhat.com/recipes/8297843#task110802732
https://beaker.engineering.redhat.com/recipes/8297178#task110796937
-------------------------------------------------------------------
[18:25:38 root@ ~~]# cat /etc/nfs.conf
[nfsdcld]
debug=1
[18:25:38 root@ ~~]# systemctl restart nfs-server
[18:25:38 root@ ~~]# systemctl status nfsdcld
* nfsdcld.service - NFSv4 Client Tracking Daemon
   Loaded: loaded (/usr/lib/systemd/system/nfsdcld.service; static; vendor preset: disabled)
   Active: active (running) since Wed 2020-05-27 18:25:38 EDT; 402ms ago
  Process: 18136 ExecStart=/usr/sbin/nfsdcld (code=exited, status=0/SUCCESS)
 Main PID: 18139 (nfsdcld)
    Tasks: 1 (limit: 11394)
   Memory: 1.0M
   CGroup: /system.slice/nfsdcld.service
           `-18139 /usr/sbin/nfsdcld

May 27 18:25:38 kvm-guest-02.rhts.eng.bos.redhat.com nfsdcld[18139]: cld_pipe_open: opening upcall pipe /var/lib/nfs/rpc_pipefs/nfsd/cld
May 27 18:25:38 kvm-guest-02.rhts.eng.bos.redhat.com nfsdcld[18139]: cld_get_version: version = 2.
May 27 18:25:38 kvm-guest-02.rhts.eng.bos.redhat.com nfsdcld[18139]: Doing downcall with status 0
May 27 18:25:38 kvm-guest-02.rhts.eng.bos.redhat.com nfsdcld[18139]: cld_gracestart: updating grace epochs
May 27 18:25:38 kvm-guest-02.rhts.eng.bos.redhat.com nfsdcld[18139]: sqlite_grace_start: current_epoch=2 recovery_epoch=1
May 27 18:25:38 kvm-guest-02.rhts.eng.bos.redhat.com nfsdcld[18139]: cld_gracestart: sending client records to the kernel
May 27 18:25:38 kvm-guest-02.rhts.eng.bos.redhat.com nfsdcld[18139]: Doing downcall with status 0
May 27 18:25:38 kvm-guest-02.rhts.eng.bos.redhat.com nfsdcld[18139]: cld_gracedone: grace done.
May 27 18:25:38 kvm-guest-02.rhts.eng.bos.redhat.com nfsdcld[18139]: sqlite_grace_done: current_epoch=2 recovery_epoch=0
May 27 18:25:38 kvm-guest-02.rhts.eng.bos.redhat.com nfsdcld[18139]: Doing downcall with status 0

Comment 19 errata-xmlrpc 2020-11-04 01:57:31 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (nfs-utils bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:4530