Skip to content

Import Lemonldap-NG Patroni backend changes#47

Open
guimard wants to merge 3 commits intomasterfrom
improve-patroni
Open

Import Lemonldap-NG Patroni backend changes#47
guimard wants to merge 3 commits intomasterfrom
improve-patroni

Conversation

@guimard
Copy link
Member

@guimard guimard commented Jan 1, 2026

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 _buildDataSource function
  • 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants