linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ric Wheeler <ricwheeler@gmail.com>
To: bhawley@luminex.com, Andrew Martin <amartin@xes-inc.com>,
	linux-nfs-owner@vger.kernel.org, linux-nfs@vger.kernel.org
Subject: Re: Optimal NFS mount options to safely allow interrupts and timeouts on newer kernels
Date: Thu, 06 Mar 2014 11:37:55 +0200	[thread overview]
Message-ID: <531841F3.10401@gmail.com> (raw)
In-Reply-To: <338027154-1394050544-cardhu_decombobulator_blackberry.rim.net-1945813324-@b5.c4.bise6.blackberry>

On 03/05/2014 10:15 PM, Brian Hawley wrote:
> In my experience, you won't get the i/o errors reported back to the read/write/close operations.   I don't know for certain, but I suspect this may be due to caching and chunking to turn I/o matching the rsize/wsize settings; and possibly the fact that the peer disconnection isn't noticed unless the nfs server resets (ie cable disconnection isn't sufficient).
>
> The inability to get the i/o errors back to the application has been a major pain for us.
>
> On a lark we did find that repeated unmont -f's does get i/o errors back to the application, but isn't our preferred way.

The key to get IO errors promptly is to make sure you use fsync/fdatasync (and 
so on) when you hit those points in your application that are where you want to 
recover from if things crash, get disconnected, etc.

Those will push out the data from the page cache while your application is still 
around which is critical for any potential need to do recovery.

Note that this is not just an issue with NFS, any file system (including local 
file systems) normally completes the write request when the IO hits the page 
cache.  When that page eventually gets sent down to the permanent storage device 
(NFS server, local disk, etc), your process is potentially no longer around and 
certainly not waiting for IO errors in the original write call :)

To make this even trickier is that the calls like fsync() that persist data have 
a substantial performance impact, so you don't want to over-use them.  (Try 
writing a 1GB file with an fsync() before close and comparing that to writing a 
1GB file opened in O_DIRECT|O_SYNC mode for the worst case for example :))

Ric


  parent reply	other threads:[~2014-03-06  9:37 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1696396609.119284.1394040541217.JavaMail.zimbra@xes-inc.com>
2014-03-05 17:45 ` Optimal NFS mount options to safely allow interrupts and timeouts on newer kernels Andrew Martin
2014-03-05 20:11   ` Jim Rees
2014-03-05 20:41     ` Andrew Martin
2014-03-05 21:11       ` Jim Rees
2014-03-06  3:34         ` NeilBrown
2014-03-06  3:47           ` Jim Rees
2014-03-06  4:37             ` NeilBrown
2014-03-05 20:15   ` Brian Hawley
2014-03-05 20:54     ` Chuck Lever
2014-03-06  9:37     ` Ric Wheeler [this message]
2014-03-06  3:50   ` NeilBrown
2014-03-06  5:03     ` Andrew Martin
2014-03-06  5:37       ` NeilBrown
2014-03-06  5:47         ` Brian Hawley
2014-03-06 15:30           ` Andrew Martin
2014-03-06 16:22             ` Jim Rees
2014-03-06 16:43               ` Andrew Martin
2014-03-06 17:36                 ` Jim Rees
2014-03-06 18:26                   ` Trond Myklebust
2014-03-06 18:35                   ` Andrew Martin
2014-03-06 18:48                     ` Jim Rees
2014-03-06 19:02                       ` Trond Myklebust
2014-03-06 18:50                     ` Trond Myklebust
2014-03-06 19:46                       ` Andrew Martin
2014-03-06 19:52                         ` Trond Myklebust
2014-03-06 20:45                           ` Andrew Martin
2014-03-06 21:01                             ` Trond Myklebust
2014-03-18 21:50                               ` Andrew Martin
2014-03-18 22:27                                 ` Trond Myklebust
2014-03-28 22:00                                   ` Dr Fields James Bruce
2014-04-04 18:15                                     ` Andrew Martin
2014-03-06 19:00                 ` Brian Hawley
2014-03-06 19:06                   ` Trond Myklebust
2014-03-06 19:14                     ` Brian Hawley
2014-03-06 19:26                       ` Trond Myklebust
2014-03-06 19:33                         ` Brian Hawley
2014-03-06 19:47                           ` Trond Myklebust
2014-03-06 19:56                             ` Brian Hawley
2014-03-06 20:31                               ` Trond Myklebust
2014-03-06 20:34                                 ` Brian Hawley
2014-03-06 20:41                                   ` Trond Myklebust
2014-03-06 19:29                       ` Ric Wheeler
2014-03-06 19:38                         ` Brian Hawley
2014-04-04 18:15                           ` Andrew Martin
2014-03-06 18:56             ` Brian Hawley
2014-03-06 12:34       ` Jim Rees
2014-03-06 15:26         ` Chuck Lever
2014-03-06 15:33           ` Trond Myklebust
2014-03-06 15:59             ` Chuck Lever
2014-03-06 16:02               ` Trond Myklebust
2014-03-06 16:13                 ` Chuck Lever
2014-03-06 16:16                   ` Trond Myklebust
2014-03-06 16:45                     ` Chuck Lever
2014-03-06 17:47                       ` Trond Myklebust
2014-03-06 20:38                         ` Chuck Lever

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=531841F3.10401@gmail.com \
    --to=ricwheeler@gmail.com \
    --cc=amartin@xes-inc.com \
    --cc=bhawley@luminex.com \
    --cc=linux-nfs-owner@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).