Shorten and beautify history log output (#1526)

when Patroni is trying to figure out the necessity of pg_rewind it could write the content history file from the primary into the log. The history file is growing with every failover/switchover and eventually starts taking too many lines in the log, most of them are not so much useful.
Instead of showing the raw data, we will show only 3 lines before the current replica timeline and 2 lines after.
This commit is contained in:
Alexander Kukushkin
2020-05-15 16:14:25 +02:00
committed by GitHub
parent 7cf0b753ab
commit 30aa355eb5
4 changed files with 39 additions and 7 deletions
+1 -1
View File
@@ -711,7 +711,7 @@ class TestPostgresql(BaseTestPostgresql):
self.assertTrue(self.p.fix_cluster_state())
def test_replica_cached_timeline(self):
self.assertEqual(self.p.replica_cached_timeline(1), 2)
self.assertEqual(self.p.replica_cached_timeline(2), 3)
def test_get_master_timeline(self):
self.assertEqual(self.p.get_master_timeline(), 1)