Skip to content

Commit

Permalink
fix(recovery): Fix recovery while using separate receivewal
Browse files Browse the repository at this point in the history
We check if use_separate_receivewal_service is active or not to set
restore_command and achrive_cleanup_command. There was a bug while calling
the recovery command from CLI. We didn't pass use_separate_receivewal_service
to the Replica class instance and thus there were no restore_comamnd and
archive_cleanup_command on the recovery config resulting in faulty data restoration.
  • Loading branch information
tparsa committed Oct 1, 2023
1 parent dd77c72 commit e6be382
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pgkit/application/pg.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ def shell(name, host, port, version, dbname, username, password, slot, replica_p
master.shell()


def recovery(name, host, port, version, dbname, username, password, slot, replica_port, time_to_recover):
def recovery(name, host, port, version, dbname, username, password, slot,
replica_port, use_separate_receivewal_service, time_to_recover):
master = Master(name, host, port, version, dbname, username, password, slot)
replica = Replica(master, replica_port, None)
replica = Replica(master, replica_port, None, use_separate_receivewal_service)

replica.recovery(time_to_recover)

Expand Down
1 change: 1 addition & 0 deletions pgkit/cli/commands/pitr.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def recover(name, target_time):
config['password'],
config['slot'],
config['replica_port'],
config.get('use_separate_receivewal_service', False),
time_to_recover=target_time
)

Expand Down

0 comments on commit e6be382

Please sign in to comment.