river stuck connected to read-only postgres instance
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Start by tracing River's leader connection and pgxpool error handling around the read-only transaction, recovery, and LISTEN failures described here. Compare that behavior with checking pg_is_in_recovery() or reconnecting through the cluster endpoint, and define done as safely recovering or stopping when the connection remains read-only; add focused coverage for the failover scenario if the existing test structure supports it.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
This scenario is admittedly operator error, but I am curious if there's anything River could do differently to self-heal.
We have a writer and reader in an AWS RDS cluster. Our service connects through a cluster endpoint which routes to the current writer. We needed to perform an OS patch so we upgraded the reader and then failed over so it became the writer. Then, we upgraded the former writer before failing back over to return to the original state. River's leader ended up pegged to the reader and could not do anything so we restarted the service to force a new connection which fixed the issue. The root cause is that a pgxpool connection obtained from the cluster endpoint is trusted as a writer for its entire lifetime, but Aurora flips roles without closing sockets.
Some of the errors we saw:
ERROR: cannot execute UPDATE in a read-only transaction (SQLSTATE 25006)
ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
error listening on topic "river_control": ERROR: cannot execute LISTEN during recovery (SQLSTATE 25006)
error scheduling jobs: ERROR: cannot execute SELECT FOR UPDATE in a read-only transaction (SQLSTATE 25006)
error cleaning jobs: ERROR: cannot execute DELETE in a read-only transaction (SQLSTATE 25006)
ERROR: cannot access temporary or unlogged relations during recovery (SQLSTATE 0A000)
If River could realize it's incorrectly connected to a read-only instance by inspecting errors or running something like pg_is_in_recovery(), it could attempt to reconnect and ultimately stop if it won't be successful. Again, I realize this is somewhat specific to our scenario ✌🏼
- Lingua principale
- Go
- Stelle
- 5.7k
- Fork
- 184
- Merge medio
- 2g 13m
- PR unite (30g)
- 32
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di riverqueue/river
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
riverqueue/river#1411 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 45/100
riverqueue/river#1358 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
River job stuck at runningAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
riverqueue/river#1258 · 7 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
riverqueue/river#1185 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
riverqueue/river#1183 · 2 reazioni ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di riverqueue/river
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
google/differential-privacy#516 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
lightninglabs/lndmon#140 ·
-
documentation good first issue ready-for-triage ready-to-code
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
release-engineering/fbc-update-planner#102 · 3 commenti ·
I maintainer di solito rispondono entro 5 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
yetone/magpie#562 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 4 giorni