Bug #71969 Advice for NFS is inconsistend.
Submitted: 7 Mar 2014 11:14 Modified: 6 Mar 2017 12:36
Reporter: Daniël van Eeden (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.6 OS:Any
Assigned to: Daniel Price CPU Architecture:Any
Triage: Needs Triage: D4 (Minor)

[7 Mar 2014 11:14] Daniël van Eeden
Description:
http://dev.mysql.com/doc/refman/5.6/en/innodb-restrictions.html
"Warning
It is not a good idea to configure InnoDB to use data files or log files on NFS volumes. Otherwise, the files might be locked by other processes and become unavailable for use by MySQL."

http://dev.mysql.com/doc/refman/5.6/en/innodb-configuration.html
"Caution
If reliability is a consideration for your data, do not configure InnoDB to use data files or log files on NFS volumes. Potential problems vary according to OS and version of NFS, and include such issues as lack of protection from conflicting writes, and limitations on maximum file sizes."

http://dev.mysql.com/doc/refman/5.6/en/tablespace-placing.html
"Do not put MySQL tables on an NFS-mounted volume. NFS uses a message-passing protocol to write to files, which could cause data inconsistency if network messages are lost or received out of order."

All pages are part of the InnoDB documentation. So why is placing an InnoDB file on NFS much more dangerous than placing an MyISAM or ARCHIVE table on NFS?

The tablespace-placing page is part of the InnoDB docs, but seems to indicate this is also valid advice for non-InnoDB tables, is that correct?

So the issues with NFS seem to be:
1. Locking
2. Maximum file size
3. inconsistency in case of out-of-order/lost network traffic

The NFSv4 protocol (RFC 3530, https://www.ietf.org/rfc/rfc3530.txt):
"The Network File System (NFS) version 4 is a distributed filesystem
 protocol which owes heritage to NFS protocol version 2, RFC 1094, and
 version 3, RFC 1813.  Unlike earlier versions, the NFS version 4
 protocol supports traditional file access while integrating support
 for file locking and the mount protocol.  In addition, support for
 strong security (and its negotiation), compound operations, client
 caching, and internationalization have been added.  Of course,
 attention has been applied to making NFS version 4 operate well in an
 Internet environment."

From http://nfs.sourceforge.net/
"Version 2 clients can access only the lowest 2GB of a file (signed 32 bit offset). Version 3 clients support larger files (up to 64 bit offsets). Maximum file size depends on the NFS server's local file systems."

So:
Issue 1 seems to be solved in NFSv4
Issue 2 seems to be solved in NFSv3
Issue 3 seems to be solved by using TCP and the hard,intr mount option

How to repeat:
See description

Suggested fix:
Combine all the NFS advice.

Update the NFS advice.

Make sure a distiction is made between NFS versions like NFSv3, NFSv4 and pNFS.

Make sure the NFS advice is on a generic page if it is not specific to InnoDB.

Maybe combine all filesystem advices on http://dev.mysql.com/doc/refman/5.6/en/disk-issues.html
[7 Mar 2014 11:47] Miguel Solorzano
Thank you for the bug report.
[12 Sep 2016 21:02] James Day
While the changes to documentation are pending, I've expanded a support document with this brief guidance:

"NFS in homebrew setups has more reliability problems than NFS in professional SAN or other storage systems which works well but may be slower than directly attached SSD or bus-attached SSD. It's a balance of features and performance, with SAN performance possibly being boosted by large caches and drive arrays. Most common issue is locked InnoDB log files after a power outage, time or switching log files solves this. Incidence of problems has declined over the last ten years and as of 2016 is now low. If possible use NFSv4 or later protocol for its improved locking handling. If concerned about out of order application of changes, not a problem normally observed in practice, consider using TCP and hard,intr mount option."

That reflects both the pragmatic experience of the support team and how to reduce the chance of trouble.

Thanks for the feedback and I definitely agree that some docs updating about NFS would be a good thing.

James Day, MySQL Senior Principal Support Engineer, Oracle
[6 Mar 2017 12:36] Daniel Price
Posted by developer:
 
NFS content was updated and consolidated into the following section:
https://dev.mysql.com/doc/refman/5.7/en/disk-issues.html#disk-issues-nfs

Thank you for the bug report.