[DPE-10062] Port Patroni/cluster code to single kernel#172
Merged
Conversation
dragomirp
commented
Jun 30, 2026
|
|
||
| # Platform specific imports | ||
| with suppress(ImportError): | ||
| from charmlibs import snap |
Contributor
Author
There was a problem hiding this comment.
So we don't need to pull the dependency on k8s.
Contributor
Author
|
Raft functions are still in the VM charm. Unit tests TBD. |
dragomirp
commented
Jun 30, 2026
Comment on lines
+593
to
+594
| if candidate is not None: | ||
| candidate = candidate.replace("/", "-") |
Contributor
Author
There was a problem hiding this comment.
From k8s, needed to switch from unit to member name.
dragomirp
commented
Jun 30, 2026
Comment on lines
+631
to
+637
| for attempt in Retrying(stop=stop_after_delay(60), wait=wait_fixed(3), reraise=True): | ||
| with attempt: | ||
| new_primary = self.get_primary() | ||
| if ( | ||
| candidate is not None and new_primary != candidate | ||
| ) or new_primary == current_primary: | ||
| raise SwitchoverFailedError("primary was not switched correctly") |
Contributor
Author
There was a problem hiding this comment.
Only on k8s, VM passes with it.
9ad1e0a to
de29c9d
Compare
de29c9d to
1bc58e4
Compare
dragomirp
commented
Jun 30, 2026
|
|
||
| def update_synchronous_node_count(self) -> None: | ||
| """Update synchronous_node_count to the minority of the planned cluster.""" | ||
| for attempt in Retrying(stop=stop_after_delay(15), wait=wait_fixed(3)): |
Contributor
Author
There was a problem hiding this comment.
Reduced from 1m. Can waste time when the charm is starting.
marceloneppel
approved these changes
Jul 1, 2026
This was referenced Jul 1, 2026
taurus-forever
approved these changes
Jul 2, 2026
marceloneppel
added a commit
that referenced
this pull request
Jul 2, 2026
The TLS stack had overridden the K8s patroni_conf path to /etc/patroni, a vestige of an earlier TLS-hardening lineage. #172's Patroni port renders patroni.yaml at patroni_conf, so it must stay the data storage root (/var/lib/pg/data); the override made a consuming charm run 'patroni /etc/patroni/patroni.yaml' against a config rendered elsewhere. TLS writes its .pem files to the separate 'tls' path (also the data dir) and does not read patroni_conf, so this revert is TLS-safe. Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Move cluster modules to single kernel.
Test PRs: