-
Notifications
You must be signed in to change notification settings - Fork 20
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
[DPE-3591] Fix shared buffers validation #361
Conversation
Signed-off-by: Marcelo Henrique Neppel <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #361 +/- ##
==========================================
- Coverage 81.33% 81.25% -0.08%
==========================================
Files 10 10
Lines 2207 2235 +28
Branches 353 360 +7
==========================================
+ Hits 1795 1816 +21
- Misses 343 347 +4
- Partials 69 72 +3 ☔ View full report in Codecov by Sentry. |
…e cache size value Signed-off-by: Marcelo Henrique Neppel <[email protected]>
Signed-off-by: Marcelo Henrique Neppel <[email protected]>
Signed-off-by: Marcelo Henrique Neppel <[email protected]>
Signed-off-by: Marcelo Henrique Neppel <[email protected]>
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.
Nice!
…uffers-validation Signed-off-by: Marcelo Henrique Neppel <[email protected]>
Signed-off-by: Marcelo Henrique Neppel <[email protected]>
Signed-off-by: Marcelo Henrique Neppel <[email protected]>
…uffers-validation Signed-off-by: Marcelo Henrique Neppel <[email protected]>
* Reenable landscape tests * Try GH runners * Back on self-hosted runner * Don't check for primary if peer didn't join yet * Don't recheck missing primary ip when looking for primary endpoint * Catch list user exception * Catch Psycopg2 error when trying to set config * Try to preflight connection on config validation * Don't retry db connection check * Set the primary endpoint before starting the primary * Revert "Set the primary endpoint before starting the primary" This reverts commit 8184dfa. * Wait for peer before starting primary * Switch to GH runners * Recheck DB connection * Don't check peer on primary startup * Try to skip primary IP validation if not all cluster IPs seem to be available * Comment * Review comments * Unit tests
* Fix shared buffers validation Signed-off-by: Marcelo Henrique Neppel <[email protected]> * Consider shared buffers config option value when calculating effective cache size value Signed-off-by: Marcelo Henrique Neppel <[email protected]> * Fix PostgreSQL restart not being called Signed-off-by: Marcelo Henrique Neppel <[email protected]> * Add and update unit test Signed-off-by: Marcelo Henrique Neppel <[email protected]> * Update unit test Signed-off-by: Marcelo Henrique Neppel <[email protected]> * Increase test timeout Signed-off-by: Marcelo Henrique Neppel <[email protected]> * Increase test timeout Signed-off-by: Marcelo Henrique Neppel <[email protected]> * Switch to GH runners * Increase stanza timeout * [MISC] Check for peer relation when getting the primary endpoint (canonical#366) * Reenable landscape tests * Try GH runners * Back on self-hosted runner * Don't check for primary if peer didn't join yet * Don't recheck missing primary ip when looking for primary endpoint * Catch list user exception * Catch Psycopg2 error when trying to set config * Try to preflight connection on config validation * Don't retry db connection check * Set the primary endpoint before starting the primary * Revert "Set the primary endpoint before starting the primary" This reverts commit 8184dfa. * Wait for peer before starting primary * Switch to GH runners * Recheck DB connection * Don't check peer on primary startup * Try to skip primary IP validation if not all cluster IPs seem to be available * Comment * Review comments * Unit tests --------- Signed-off-by: Marcelo Henrique Neppel <[email protected]> Co-authored-by: Dragomir Penev <[email protected]> Co-authored-by: Dragomir Penev <[email protected]>
Issue
The validation for the
shared_buffers
parameter was not correct. The calculus of the maximum allowed shared buffers value was not correctly converting the available memory for that to the same unit as theshared_buffers
parameter that the user informs.Also, the
effective_cache_size
parameter did not consider the user-providedshared_buffers
value.One last issue: sometimes, the restart of the PostgreSQL database was not triggered because Patroni hadn't finished reloading the configuration (even after 10 seconds).
Solution
Fix the calculus of the maximum allowed shared buffers value to be in the same unit as the user-provided value.
Considered the user-provided shared buffers value for the effective cache size parameter calculus.
An improved retry mechanism was added to check whether a restart is needed after a configuration change.
Unit tests for the library file are being updated to the K8S charm, which owns the library.