Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR imports Lemonldap-NG Patroni backend changes that significantly enhance the resilience and reliability of PostgreSQL cluster connections through the Patroni API. The changes replace the simple knownMappings cache with a comprehensive patroniCache system that includes circuit breaker functionality, leader caching with TTL, split-brain detection, and health state validation.
Key changes:
- Implements circuit breaker pattern to avoid hammering failing Patroni APIs
- Adds configurable leader caching with TTL support (default 60s)
- Adds split-brain detection and enhanced validation (leader state, required fields)
- Refactors DSN building logic into a dedicated
_buildDataSourcefunction - Updates documentation with resilience features and configuration examples
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/Apache/Session/Browseable/Store/Patroni.pm | Core implementation: replaces knownMappings with patroniCache, adds circuit breaker, leader validation, and new helper methods (_useCachedLeader, _buildDataSource) |
| lib/Apache/Session/Browseable/Patroni.pm | Updates documentation to fix spelling error, correct module examples, and document new resilience features with configuration parameters |
| t/Apache-Session-Browseable-Store-Patroni.t | Comprehensive new test file (589 lines, 34 tests) covering cache behavior, circuit breaker, leader validation, split-brain detection, and mocked HTTP scenarios |
| Build.PL | Adds LWP::Protocol::PSGI test dependency and bumps distribution version to 1.3.18 |
| .github/workflows/ci.yml | Updates CI to install liblwp-protocol-psgi-perl package for testing |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.