Skip to content

Commit

Permalink
support-v15&14 (#9)
Browse files Browse the repository at this point in the history
* fix cli version tags

* add recovery.conf for v14 and v15

* modify replica model

* remove sudo commands

* fix commented recovery_min_apply_delay line

* modify handling of recovery_min_apply_delay line

* fix commented recovery_min_apply_delay line

---------

Co-authored-by: amin <mohamad.zangooei.1999@gmail.com>
  • Loading branch information
moAmza and AAA2222A authored Oct 1, 2023
1 parent 3ad2b6c commit a901655
Show file tree
Hide file tree
Showing 4 changed files with 1,679 additions and 4 deletions.
5 changes: 3 additions & 2 deletions pgkit/application/models/replica.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ def create_base_backup(self):

def recovery(self, target_time):
self.configure_recovery_file(recovery=True, recovery_target_time=target_time)
self._rename_partial_wal_file()
if self.use_separate_receivewal_service:
self._rename_partial_wal_file()
self.restart()

def get_config_parameter_value(self, parameter):
Expand Down Expand Up @@ -256,7 +257,7 @@ def _get_current_delay(self):

config = read_file(file_location)
for line in config.split('\n'):
if 'recovery_min_apply_delay' in line:
if line.startswith('recovery_min_apply_delay'):
return int(line.split(' ')[2].split("min")[0]) / 60

def _get_replication_slot_status(self):
Expand Down
Loading

0 comments on commit a901655

Please sign in to comment.