Skip to content

feat: wait for primary to be detected#936

Closed
levkk wants to merge 1 commit intomainfrom
levkk-speed-up-failover
Closed

feat: wait for primary to be detected#936
levkk wants to merge 1 commit intomainfrom
levkk-speed-up-failover

Conversation

@levkk
Copy link
Copy Markdown
Collaborator

@levkk levkk commented Apr 27, 2026

fix #927

[general]
read_write_strategy = "conservative_primary_required"

This will pause all queries until a primary is detected by lsn_check_interval. This will prevent this error:

 cannot execute INSERT in a read-only transaction

since PgDog won't allow any queries through until a primary is detected, so a write won't be sent to a replica.

This is not default behavior because primary databases are optional, i.e. pgdog can proxy a set of replicas only, so a primary will never be detected.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 27, 2026

Codecov Report

❌ Patch coverage is 51.35135% with 18 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pgdog/src/backend/pool/shard/mod.rs 33.33% 10 Missing ⚠️
pgdog/src/backend/pool/lb/mod.rs 0.00% 5 Missing ⚠️
pgdog/src/backend/pool/cluster.rs 71.42% 2 Missing ⚠️
pgdog/src/backend/pool/shard/monitor.rs 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@levkk
Copy link
Copy Markdown
Collaborator Author

levkk commented Apr 27, 2026

#941

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.

Intermittent error: WARN new primary chosen

1 participant