kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject [5/5] kudu git commit: env_posix: improve error message on short writes
Date Sat, 13 Aug 2016 02:08:50 GMT
env_posix: improve error message on short writes

System calls like write() and pwritev() can sometimes return a 'short'
result, which is an error. The typical cause for this is that the disk
is out of space. This just improves the error message to include that
hint.

Change-Id: I31627ad24ccddaa1afb30b05c4f43dee99c82a94
Reviewed-on: http://gerrit.cloudera.org:8080/3959
Tested-by: Kudu Jenkins
Reviewed-by: Dan Burkert <dan@cloudera.com>


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/13dde92b
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/13dde92b
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/13dde92b

Branch: refs/heads/master
Commit: 13dde92b0fc42275c9bcc2954d0559830ac640e8
Parents: 609054c
Author: Todd Lipcon <todd@apache.org>
Authored: Fri Aug 12 15:04:47 2016 -0700
Committer: Todd Lipcon <todd@apache.org>
Committed: Sat Aug 13 02:08:18 2016 +0000

----------------------------------------------------------------------
 src/kudu/util/env_posix.cc | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/13dde92b/src/kudu/util/env_posix.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/env_posix.cc b/src/kudu/util/env_posix.cc
index 773971f..4bc14f8 100644
--- a/src/kudu/util/env_posix.cc
+++ b/src/kudu/util/env_posix.cc
@@ -471,7 +471,8 @@ class PosixWritableFile : public WritableFile {
 
     if (PREDICT_FALSE(written != nbytes)) {
       return Status::IOError(
-          Substitute("pwritev error: expected to write $0 bytes, wrote $1 bytes instead",
+          Substitute("pwritev error: expected to write $0 bytes, wrote $1 bytes instead"
+                     " (perhaps the disk is out of space)",
                      nbytes, written));
     }
 #else
@@ -488,7 +489,8 @@ class PosixWritableFile : public WritableFile {
 
       if (PREDICT_FALSE(written != data.size())) {
         return Status::IOError(
-            Substitute("pwrite error: expected to write $0 bytes, wrote $1 bytes instead",
+            Substitute("pwrite error: expected to write $0 bytes, wrote $1 bytes instead"
+                       " (perhaps the disk is out of space)",,
                        data.size(), written));
       }
     }
@@ -560,7 +562,8 @@ class PosixRWFile : public RWFile {
 
     if (PREDICT_FALSE(written != data.size())) {
       return Status::IOError(
-          Substitute("pwrite error: expected to write $0 bytes, wrote $1 bytes instead",
+          Substitute("pwrite error: expected to write $0 bytes, wrote $1 bytes instead"
+                     " (perhaps the disk is out of space)",
                      data.size(), written));
     }
 


Mime
View raw message