The 7 Things I Know About Cyber Security After 25 Years | April 2024
Oracle database might have problems with stale NFSv3 locks upon restart
1. Oracle database might have problems
with stale NFS locks upon restart!
Applies to: NFSv3
Cause: Creating a lock (NLM) and clearing (rpc.statd) a lock use two slightly different methods of
name resolution.
• NLM = uses uname -n to determine the host name
• rpc.statd = uses gethostbyname() to determine the host name
lockd = lockd is a kernel thread which runs on both clients and servers. It implements the Network
Lock Manager (NLM) protocol, which allows NFSv2 and NFSv3 clients to lock files on the server. It is
started automatically whenever the NFS server is run and whenever an NFS file system is mounted.
rpc.statd = This process implements the Network Status Monitor (NSM) RPC protocol, which notifies
NFS clients when an NFS server is restarted without being gracefully brought down. rpc.statd is
started automatically by the nfslock service, and does not require user configuration. This is not used
with NFSv4.
Why is lock required for NFSv3?
NFS version 3 protocol is stateless, an additional Network Lock Manager (NLM) protocol is required
to support locking of NFS-mounted files.
NFSv4 is a true stateful protocol : By 'true' stateful, I mean NFSv4 includes file-locking as part of the
protocol itself, rather than relying on Network Lock Manager (NLM) to provide that function as
NFSv3 does. Hence, the locks are dealt with more efficiently. These days, most (if not all) Linux
distributions default to NFSv4 and the most popular one Red Hat Enterprise Linux uses NFSv4 by
default, if the server supports it.
2. Solution:
These host names must match for the OS to properly clear stale locks.
For example: The host might be looking for locks owned by "dbserver", but the locks were registered
by the host as "dbserver.domain.com", If gethostbyname() does not return the same value as
"uname –a", then the lock release process will not succeed.
Steps to fix:
Change the order in which hosts appear in /etc/hosts.
For example, assume that the hosts file includes this entry:
192.x.x.x dbserver.domain.com dbserver
Change this to,
192.x.x.x dbserver dbserver.domain.com
ashwinwriter@gmail.com
June, 2020