Update optime/leader with checkpoint location after clean shut down (#1527)

Potentially this information could be used in order to make sure that there is no data loss on switchover.
This commit is contained in:
Alexander Kukushkin
2020-05-15 16:13:16 +02:00
committed by GitHub
parent 285bffc68d
commit 7cf0b753ab
10 changed files with 52 additions and 16 deletions
+5
View File
@@ -338,6 +338,11 @@ class TestPostgresql(BaseTestPostgresql):
with patch.object(Postgresql, '_query', Mock(side_effect=RetryFailedError(''))):
self.assertRaises(PostgresConnectionException, self.p.is_leader)
@patch.object(Postgresql, 'controldata',
Mock(return_value={'Database cluster state': 'shut down', 'Latest checkpoint location': 'X/678'}))
def test_latest_checkpoint_location(self):
self.assertIsNone(self.p.latest_checkpoint_location())
def test_reload(self):
self.assertTrue(self.p.reload())