diff options
| author | Sunny Kumar <sunkumar@redhat.com> | 2020-03-16 15:17:23 +0000 | 
|---|---|---|
| committer | Amar Tumballi <amar@kadalu.io> | 2020-03-17 04:25:27 +0000 | 
| commit | 5410cc35ea09b1932c8eae4933fbf84f462e61ea (patch) | |
| tree | 8493d5e63124b6dd4551bbd1baa1a1af4a6e5b04 | |
| parent | 476139c962c298b2d00a3d42b90632fc25401526 (diff) | |
geo-rep: descriptive message when worker crashes due to EIO
With this patch now you can notice log if it is due to EIO:
[2020-03-16 16:24:48.293837] E [syncdutils(worker /bricks/brick1/mbr3):348:log_raise_exception] <top>: Getting "Input/Output error" is most likely due to a. Brick is down or b. Split brain issue.
[2020-03-16 16:24:48.293915] E [syncdutils(worker /bricks/brick1/mbr3):352:log_raise_exception] <top>: This is expected as per design to keep the consistency of the file system. Once the above issue is resolved geo-rep would automatically proceed further.
Change-Id: Ie33f2440bc96089731ce12afa8dab91d9550a7ca
Fixes: #1104
Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
| -rw-r--r-- | geo-replication/syncdaemon/syncdutils.py | 13 | 
1 files changed, 12 insertions, 1 deletions
diff --git a/geo-replication/syncdaemon/syncdutils.py b/geo-replication/syncdaemon/syncdutils.py index dc0366266b9..f1dd14f0d9d 100644 --- a/geo-replication/syncdaemon/syncdutils.py +++ b/geo-replication/syncdaemon/syncdutils.py @@ -22,7 +22,7 @@ import socket  from subprocess import PIPE  from threading import Lock, Thread as baseThread  from errno import EACCES, EAGAIN, EPIPE, ENOTCONN, ENOMEM, ECONNABORTED -from errno import EINTR, ENOENT, ESTALE, EBUSY, ENODATA, errorcode +from errno import EINTR, ENOENT, ESTALE, EBUSY, ENODATA, errorcode, EIO  from signal import signal, SIGTERM  import select as oselect  from os import waitpid as owaitpid @@ -344,6 +344,17 @@ def log_raise_exception(excont):                                                          ECONNABORTED):              logging.error(lf('Gluster Mount process exited',                               error=errorcode[exc.errno])) +        elif isinstance(exc, OSError) and exc.errno == EIO: +            logging.error("Getting \"Input/Output error\" " +                          "is most likely due to " +                          "a. Brick is down or " +                          "b. Split brain issue.") +            logging.error("This is expected as per design to " +                          "keep the consistency of the file system. " +                          "Once the above issue is resolved " +                          "geo-replication would automatically " +                          "proceed further.") +            logtag = "FAIL"          else:              logtag = "FAIL"          if not logtag and logging.getLogger().isEnabledFor(logging.DEBUG):  | 
