-
Notifications
You must be signed in to change notification settings - Fork 26
Enable Sync Mode #134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable Sync Mode #134
Conversation
PATRONI_PROCESS = "/usr/local/bin/patroni" | ||
APP_NAME = METADATA["name"] | ||
PATRONI_PROCESS = "/usr/bin/patroni" | ||
POSTGRESQL_PROCESS = "postgres" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are likely hitting the same pkill issues as the VM charm here, though we may want to deal with that in a separate PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! I'll check it and update the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated on https://github.com/canonical/postgresql-k8s-operator/pull/134/files/b79aa19b4a9f197c575d25345c780b47bb9f2d0d..c29e5cd37540872c7e19973598d8c77576d5388a. I used the same logic that we have in the VM charm (SIGINT). I'm going to open another PR to reenable the PG process freeze db test.
return resp.json() | ||
|
||
|
||
async def change_master_start_timeout(ops_test: OpsTest, seconds: Optional[int]) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should switch this to primary
since we are now on patroni 3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reverted it due to changes needed to address the above comment.
This reverts commit 84d810d.
https://warthogs.atlassian.net/browse/DPE-1456 --------- Co-authored-by: Dragomir Penev <dragomir.penev@canonical.com>
Issue
Jira ticket: DPE-1456
Sync mode is not enabled, which can cause data loss.
Solution
Enable sync mode in the Patroni configuration and set the synchronous node code to the cluster minority.
In
src/charm.py
:In
templates/patroni.yml.j2
:In
tests/integration/ha_tests/application-charm/*
:In
tests/integration/helpers.py
:In
tests/integration/test_tls.py
:sync_standby
.