-
Notifications
You must be signed in to change notification settings - Fork 26
[MISC] Conditional password #604
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #604 +/- ##
==========================================
- Coverage 70.85% 70.81% -0.04%
==========================================
Files 12 12
Lines 3043 3039 -4
Branches 538 537 -1
==========================================
- Hits 2156 2152 -4
Misses 771 771
Partials 116 116 ☔ View full report in Codecov by Sentry. |
{%- if patroni_password %} | ||
authentication: | ||
username: patroni | ||
password: {{ patroni_password }} | ||
{%- endif %} |
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.
If the leader elected executes after the template is rendered we'll be stuck with None
pass and will be unable to reload via the REST API
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.
Can this happen in wild? What is our answer there?
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 don't think so, but when we add rotation (DPE-5270) we should switch to SIGHUPing the service instead of reloading via REST.
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.
Basic question: At which point during charm execution the patroni template is rendered?
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.
2 @lucasgameiroborges good to have this answer in https://charmhub.io/postgresql-k8s/docs/e-flowchart-charm for VM charm :-D
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.
Basic question: At which point during charm execution the patroni template is rendered?
I don't think there's a set order, especially during charm's bootstrap.
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 might ask @marceloneppel once hes back, might be good to have this clear and documented somewhere (maybe on the diagrams!)
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 believe that the issue might be happening at
postgresql-operator/src/upgrade.py
Line 149 in 5f546f1
self.charm.update_config() |
The changes from this PR LGTM.
raft_encryption = ( | ||
int( | ||
json.loads(self.peer_relation.data[self.charm.app].get("dependencies", "{}")) | ||
.get("charm", {}) | ||
.get("version", 0) | ||
) | ||
< 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.
Looks like the 503 errors were API related not RAFT related.
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.
LGTM. The Patroni 503 is know reply when it is not-yet-started.
I am askin @marceloneppel to request upstream change it to 603 declined whole Patroni is starting... so we can recognize the real 503 internal errors and react or continue waiting...
{%- if patroni_password %} | ||
authentication: | ||
username: patroni | ||
password: {{ patroni_password }} | ||
{%- endif %} |
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.
Can this happen in wild? What is our answer there?
Conditionally add REST password to patroni config