hapostgres / hapostgres/pg_auto_failover
default_transaction_read_only is not set to on for standbys
- Lingua principale
- C
- Stelle
- 1.4k
- Fork
- 142
- Merge medio
- 5h 8m
- PR unite (30g)
- 1
Descrizione
Moving from postgres 13 to 15 i bumped into an issue using `target_session_attrs=read-write`, where `default_transaction_read_only` would be `off` on standbys, resulting in clients connecting to the standby.
I have worked around it by switching `target_session_attrs` to `primary` instead of `read-write` which works for our case.
Now the weird thing is that `show transaction_read_only` returns `on`, but `show default_transaction_read_only` returns `off`. `default_transaction_read_only` also reports off in the connection startup parameters.
The reason it worked in postgres 13 is because postgres doesn't send `default_transaction_read_only` on startup so the client falls back to checking by `show transaction_read_only`.
If I call `alter system set default_transaction_read_only to on` and `select pg_reload_conf()` myself on the standbys they return `on` for `default_transaction_read_only` as expected.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia riproducendo il comportamento di PostgreSQL dalla versione 13 alla 15 su uno standby usando target_session_attrs=read-write, quindi confronta SHOW transaction_read_only con SHOW default_transaction_read_only e con i parametri di avvio della connessione. Traccia il modo in cui pg_auto_failover configura le sessioni dello standby e verifica che il valore predefinito riportato sia coerente con lo stato dello standby senza richiedere manualmente ALTER SYSTEM o pg_reload_conf().
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- postgresql
- Ambito
- databases, distributed-systems
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 38/100