New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection close throws exception issuing a reset on read replica (standby) #2203

Open
palnpgsql opened this Issue Oct 23, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@palnpgsql

palnpgsql commented Oct 23, 2018

Steps to reproduce

Create an aws postgres database, then create an Amazon RDS Read Replica of that Database.
Open a connection to the Read Replica. Call Dispose on the connection .
https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReadRepl.html

The issue

Dispose issues an unlisten command. This should throw a exception that cannot write to the database. The unlisten command needs a write enabled connection because it inserts.
This initially occurred in our system with Pooling=true and No Reset On Close=false

Exception message:
Stack trace:

Further technical details

Npgsql version: 4.01
PostgreSQL version: 9.6.8
Operating system: AWS

Other details about my project setup:
the database is a Read Replica

@palnpgsql palnpgsql changed the title from Connection throw exception issuing a reset on an AWS postgres read replica to Connection throws exception issuing a reset on an AWS postgres read replica Oct 23, 2018

@roji

This comment has been minimized.

Member

roji commented Oct 25, 2018

Note: PR #2205 submitted for this.

@roji

This comment has been minimized.

Member

roji commented Oct 25, 2018

A good way to deal with this would be to set No Reset On Close=true, can you confirm that you've tried that and whether it solves your problem? Is there any particular reason you can't use this option?

@roji

This comment has been minimized.

Member

roji commented Oct 25, 2018

Note: posted this question on the pghackers list to see about the possibility of having UNLISTEN work in standby mode.

@roji

This comment has been minimized.

Member

roji commented Nov 18, 2018

Trivial patch submitted to PostgreSQL for removing the recovery check for UNLISTEN.

@roji roji changed the title from Connection throws exception issuing a reset on an AWS postgres read replica to Connection close throws exception issuing a reset on read replica (standby) Nov 19, 2018

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