Hot Standby, max_connections and max_prepared_transactions

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Hot Standby, max_connections and max_prepared_transactions
Date: 2009-09-03 18:22:45
Message-ID: 1252002165.2889.467.camel@ebony.2ndQuadrant
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


We discussed earlier that HS should continue to work even if
max_connections was set differently on the primary and the standby. This
now gives a situation where snapshots can be allowed, then disallowed
for a while, then allowed again.

Complication is that this will cause some connections to fail since we
take a snapshot in postinit.c. (That is the part I just noticed in my
self-review). Some queries will also fail. Sometimes, not all the time.

This makes both behaviour and coding more complicated and my feeling is
that if we are aiming for simplicity in all areas we should remove
this.

Currently max_prepared_transactions needs to be set correctly in
recovery also, so this complex coding doesn't actually remove the need
to set some parameters correctly. Not many people change them from the
default in the first place, so I don't think its a big deal. And most
people use the same postgresql.conf on the standby anyway.

I propose we just accept that both max_connections and
max_prepared_transactions need to be set correctly for recovery to work.
This will make the state transitions more robust and it will avoid
spurious and hard to test error messages.

Any objections to me removing this slice of code from the patch?

--
Simon Riggs www.2ndQuadrant.com

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Selena Deckelmann 2009-09-03 18:24:39 Re: [HACKERS] Commitfest Code Sprint with PUGs
Previous Message Robert Haas 2009-09-03 18:19:57 Re: Triggers on columns