Blame SOURCES/sos-bz1658939-postgresql-collect-full-dump.patch

fce3c4
From 47e6b3d92c8a13560b248e6f0e2ffb334b547d07 Mon Sep 17 00:00:00 2001
fce3c4
From: Yedidyah Bar David <didi@redhat.com>
fce3c4
Date: Tue, 4 Dec 2018 13:08:44 +0200
fce3c4
Subject: [PATCH] [Plugin] Obey sizelimit=0
fce3c4
fce3c4
If sizelimit is 0, do not limit. Only use the default if it's None.
fce3c4
fce3c4
Bug-Url: https://bugzilla.redhat.com/1654068
fce3c4
Signed-off-by: Yedidyah Bar David <didi@redhat.com>
fce3c4
---
fce3c4
 sos/plugins/__init__.py | 6 ++++--
fce3c4
 1 file changed, 4 insertions(+), 2 deletions(-)
fce3c4
fce3c4
diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py
fce3c4
index 7d2a8b2d..97f3cc59 100644
fce3c4
--- a/sos/plugins/__init__.py
fce3c4
+++ b/sos/plugins/__init__.py
fce3c4
@@ -569,7 +569,8 @@ class Plugin(object):
fce3c4
         a single file the file will be tailed to meet sizelimit. If the first
fce3c4
         file in a glob is too large it will be tailed to meet the sizelimit.
fce3c4
         """
fce3c4
-        sizelimit = sizelimit or self.get_option("log_size")
fce3c4
+        if sizelimit is None:
fce3c4
+            sizelimit = self.get_option("log_size")
fce3c4
 
fce3c4
         if self.get_option('all_logs'):
fce3c4
             sizelimit = None
fce3c4
@@ -703,7 +704,8 @@ class Plugin(object):
fce3c4
             cmds = [cmds]
fce3c4
         if len(cmds) > 1 and (suggest_filename or root_symlink):
fce3c4
             self._log_warn("ambiguous filename or symlink for command list")
fce3c4
-        sizelimit = sizelimit or self.get_option("log_size")
fce3c4
+        if sizelimit is None:
fce3c4
+            sizelimit = self.get_option("log_size")
fce3c4
         for cmd in cmds:
fce3c4
             self._add_cmd_output(cmd, suggest_filename=suggest_filename,
fce3c4
                                  root_symlink=root_symlink, timeout=timeout,
fce3c4
-- 
fce3c4
2.17.2
fce3c4
fce3c4
From 254d93499d64acaff5103e15c25649d418004737 Mon Sep 17 00:00:00 2001
fce3c4
From: Yedidyah Bar David <didi@redhat.com>
fce3c4
Date: Tue, 4 Dec 2018 13:10:32 +0200
fce3c4
Subject: [PATCH] [postgresql] Do not limit dump size
fce3c4
fce3c4
In principle, this might be risky - if a database is huge, we might not
fce3c4
want to collect all of it. But there is no sense in collecting only its
fce3c4
tail. If this turns out problematic, a future patch might check db size
fce3c4
and do not collect it at all if it's too large.
fce3c4
fce3c4
Bug-Url: https://bugzilla.redhat.com/1654068
fce3c4
fce3c4
Resolves: #1497
fce3c4
fce3c4
Signed-off-by: Yedidyah Bar David <didi@redhat.com>
fce3c4
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
fce3c4
---
fce3c4
 sos/plugins/postgresql.py | 2 +-
fce3c4
 1 file changed, 1 insertion(+), 1 deletion(-)
fce3c4
fce3c4
diff --git a/sos/plugins/postgresql.py b/sos/plugins/postgresql.py
fce3c4
index d47f7e8b..aef431f8 100644
fce3c4
--- a/sos/plugins/postgresql.py
fce3c4
+++ b/sos/plugins/postgresql.py
fce3c4
@@ -64,7 +64,7 @@ class PostgreSQL(Plugin):
fce3c4
                 if scl is not None:
fce3c4
                     cmd = self.convert_cmd_scl(scl, cmd)
fce3c4
                 self.add_cmd_output(cmd, suggest_filename=filename,
fce3c4
-                                    binary=True)
fce3c4
+                                    binary=True, sizelimit=0)
fce3c4
 
fce3c4
             else:  # no password in env or options
fce3c4
                 self.soslog.warning(
fce3c4
-- 
fce3c4
2.17.2
fce3c4