Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ and this project follows [Semantic Versioning](https://semver.org/).
- Preserve pgBackRest recovery options as one shell-safe argument during remote restore.
- Preserve the complete pgBackRest command as the single `bash -lc` command string.
- Run component rollback in local Ruby context instead of an SSHKit backend scope.
- Explicitly stop SysV-backed repmgrd before disabling it on manual-failover standbys.

## 0.9.6 - 2026-08-20

Expand Down
3 changes: 2 additions & 1 deletion lib/active_postgres/components/repmgr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,8 @@ def update_postgres_configs_on_standby(host, version)
def enable_repmgrd_if_configured(host, repmgr_config)
if repmgr_config[:auto_failover] == false
ssh_executor.execute_on_host(host) do
execute :sudo, 'systemctl', 'disable', '--now', 'repmgrd', raise_on_non_zero_exit: false
execute :sudo, 'systemctl', 'stop', 'repmgrd', raise_on_non_zero_exit: false
execute :sudo, 'systemctl', 'disable', 'repmgrd', raise_on_non_zero_exit: false
end
return
end
Expand Down
3 changes: 2 additions & 1 deletion test/repmgr_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ def test_manual_failover_policy_disables_repmgrd
component.send(:enable_repmgrd_if_configured, 'standby.example.com', auto_failover: false)

assert_equal [
[[:sudo, 'systemctl', 'disable', '--now', 'repmgrd'], { raise_on_non_zero_exit: false }]
[[:sudo, 'systemctl', 'stop', 'repmgrd'], { raise_on_non_zero_exit: false }],
[[:sudo, 'systemctl', 'disable', 'repmgrd'], { raise_on_non_zero_exit: false }]
], commands
end

Expand Down