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

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