Ignore synchronous_mode setting in a standby cluster (#2896)

is_synchronous_mode() should always return False in standby clusters
This commit is contained in:
Polina Bungina
2023-10-06 10:21:37 +02:00
committed by GitHub
parent 9283ebda64
commit efacc6c16b
4 changed files with 26 additions and 13 deletions
+6 -1
View File
@@ -5,7 +5,7 @@ import io
from copy import deepcopy
from mock import MagicMock, Mock, patch
from patroni.config import Config, ConfigParseError
from patroni.config import Config, ConfigParseError, GlobalConfig
class TestConfig(unittest.TestCase):
@@ -197,3 +197,8 @@ class TestConfig(unittest.TestCase):
self.assertEqual(mock_logger.call_args_list[0][0],
('Violated the rule "loop_wait + 2*retry_timeout <= ttl", where ttl=%d. Adjusting'
' loop_wait from %d to %d and retry_timeout from %d to %d', 20, 10, 1, 10, 9))
def test_global_config_is_synchronous_mode(self):
# we should ignore synchronous_mode setting in a standby cluster
config = {'standby_cluster': {'host': 'some_host'}, 'synchronous_mode': True}
self.assertFalse(GlobalConfig(config).is_synchronous_mode)