ozontech / ozontech/pg_doorman
patroni_proxy does not detect replicas after Patroni state change from running to streaming
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 275
- Forks
- 12
- PR merge metrics
- No merged PRs in 30d
Description
After a recent Patroni version/configuration change, replica members in the cluster no longer appear as eligible backends for patroni_proxy. As a result, the proxy reports zero available replica members and refuses to route connections to the replica port.
Log:
DEBUG patroni_proxy::cluster_manager: Port 'patroni_cluster:master': 1 backends available
DEBUG patroni_proxy::port: Port 'patroni_cluster:sync': updated backends, 0 members available
The reason seems to be that Patroni changed the replica State value from "running" to "streaming"
In src/bin/patroni_proxy/port.rs, the function is_member_eligible() at lines 191–192 still checks the old state and does not account for the new streaming state.
fn is_member_eligible(&self, member: &Member) -> bool {
// Check state - must be running
if member.state != "running" {
return false;
}
It may be necessary to replace the line with:
if member.state != "running" && member.state != "streaming" {
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/bin/patroni_proxy/port.rs at is_member_eligible() and inspect how Patroni member states are checked. Confirm that members in the streaming state are accepted while other ineligible states remain rejected, then verify that the replica port reports available backends instead of zero members.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, rust
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 82/100