-
Notifications
You must be signed in to change notification settings - Fork 27
[DPE-8932] Strict mode configuration #1389
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
base: 16/edge
Are you sure you want to change the base?
Conversation
e0f03fd to
315f821
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 16/edge #1389 +/- ##
===========================================
+ Coverage 70.53% 70.64% +0.11%
===========================================
Files 16 16
Lines 4297 4293 -4
Branches 691 689 -2
===========================================
+ Hits 3031 3033 +2
+ Misses 1055 1050 -5
+ Partials 211 210 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
0e04de2 to
d974297
Compare
| if value < 2: | ||
| from pydantic_core import InitErrorDetails | ||
|
|
||
| raise ValidationError.from_exception_data( | ||
| "ValidationError", | ||
| [ | ||
| InitErrorDetails( | ||
| type="greater_than_equal", | ||
| ctx={"ge": 2}, | ||
| input=value, | ||
| loc=("cpu_max_worker_processes",), | ||
| ) | ||
| ], | ||
| ) |
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.
Pydantic can validate this, there's no need to check separately.
| # Update the configuration. | ||
| self._charm.set_unit_status(MaintenanceStatus("updating configuration"), refresh=refresh) | ||
| self._charm.update_config(refresh=refresh) | ||
| self._charm.updated_synchronous_node_count() |
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.
Should be called inside _charm.update_config().
d974297 to
2b2e4a7
Compare
|
|
||
| base_patch = {} | ||
| base_patch = { | ||
| **self._patroni.synchronous_configuration, |
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.
Update the sync node count and strict mode together with the other config params. To reduce the amount of PATCH calls.
| base_patch = {} | ||
| base_patch = { | ||
| **self._patroni.synchronous_configuration, | ||
| "maximum_lag_on_failover": self.config.durability_maximum_lag_on_failover, |
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.
Patroni param, so should be part of the base patch.
d658b06 to
52cb476
Compare
Issue
Solution
Checklist