From 6d00034fa785bb5cec306591e833e6d5f7171609 Mon Sep 17 00:00:00 2001 From: alek-mlab Date: Fri, 10 Aug 2018 16:36:37 -0700 Subject: [PATCH 1/2] Added `MongodumpFailedAfterDowngrade` to the error handler --- mbs/errors.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mbs/errors.py b/mbs/errors.py index 49d685a..3ec043d 100644 --- a/mbs/errors.py +++ b/mbs/errors.py @@ -366,6 +366,10 @@ def __init__(self, return_code=None, error_log_line=None, last_namespace=None): class InvalidBSONObjSizeError(RetriableDumpError): pass +############################################################################### +class MongodumpFailedAfterDowngrade(DumpError): + pass + ############################################################################### class CorruptionError(InvalidBSONObjSizeError): pass @@ -1002,6 +1006,8 @@ def raise_dump_error(returncode, error_log_line, last_namespace=None): error_type = OplogOverflowError elif "mongoctl error" in error_log_line and "Unable to find a compatible 'mongodump'" in error_log_line: error_type = NoCompatibleMongodumpExeFoundError + elif "config.system.sessions: not authorized on config to execute command" in error_log_line: + error_type = MongodumpFailedAfterDowngrade elif returncode == 245: # segmentation fault error_type = MongodumpSegmentationFaultError # Generic retriable errors From afeb0047fbb3f6062dd36858b757e3d747b345ad Mon Sep 17 00:00:00 2001 From: alek-mlab Date: Tue, 14 Aug 2018 14:41:48 -0700 Subject: [PATCH 2/2] Generalised error name --- mbs/errors.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mbs/errors.py b/mbs/errors.py index 3ec043d..7996eb4 100644 --- a/mbs/errors.py +++ b/mbs/errors.py @@ -367,7 +367,7 @@ class InvalidBSONObjSizeError(RetriableDumpError): pass ############################################################################### -class MongodumpFailedAfterDowngrade(DumpError): +class UnauthorizedToDumpCollectionError(DumpError): pass ############################################################################### @@ -1007,7 +1007,7 @@ def raise_dump_error(returncode, error_log_line, last_namespace=None): elif "mongoctl error" in error_log_line and "Unable to find a compatible 'mongodump'" in error_log_line: error_type = NoCompatibleMongodumpExeFoundError elif "config.system.sessions: not authorized on config to execute command" in error_log_line: - error_type = MongodumpFailedAfterDowngrade + error_type = UnauthorizedToDumpCollectionError elif returncode == 245: # segmentation fault error_type = MongodumpSegmentationFaultError # Generic retriable errors