mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-01-27 10:20:10 +00:00
Merge branch 'master' of github.com:zalando/patroni into codequality
This commit is contained in:
@@ -256,10 +256,7 @@ class Postgresql(object):
|
||||
that does not require a running leader to create the replica.
|
||||
"""
|
||||
replica_methods = self.config.get('create_replica_method', [])
|
||||
for replica_method in replica_methods:
|
||||
if self.replica_method_can_work_without_leader(replica_method):
|
||||
return True
|
||||
return False
|
||||
return any(self.replica_method_can_work_without_leader(replica_method) for replica_method in replica_methods)
|
||||
|
||||
def create_replica(self, leader, env):
|
||||
# create the replica according to the replica_method
|
||||
@@ -492,7 +489,7 @@ recovery_target_timeline = 'latest'
|
||||
# first run a checkpoint on a promoted master in order
|
||||
# to make it store the new timeline (5540277D.8020309@iki.fi)
|
||||
self.checkpoint(r)
|
||||
logger.info("running pg_rewind from {0}".format(pc))
|
||||
logger.info("running pg_rewind from %s", pc)
|
||||
pg_rewind = ['pg_rewind', '-D', self.data_dir, '--source-server', pc]
|
||||
try:
|
||||
ret = subprocess.call(pg_rewind, env=env) == 0
|
||||
|
||||
@@ -197,6 +197,12 @@ y''')
|
||||
])
|
||||
assert 'You need to specify' in str(result.output)
|
||||
|
||||
result = runner.invoke(ctl, [
|
||||
'query',
|
||||
'alpha'
|
||||
])
|
||||
assert 'You need to specify' in str(result.output)
|
||||
|
||||
result = runner.invoke(ctl, [
|
||||
'query',
|
||||
'alpha',
|
||||
|
||||
Reference in New Issue
Block a user