Re: [HACKERS] default_transaction_isolation = serializable causes crash under Hot Standby

2012-04-30 Thread Kevin Grittner
Robert Haas robertmh...@gmail.com wrote: Simon Riggs si...@2ndquadrant.com wrote: * throw a WARNING if serializable is stated in other cases, and downgrade the request to repeatable read I think this would be reasonable, but it's still my second choice. The advantage of throwing an ERROR

Re: [HACKERS] default_transaction_isolation = serializable causes crash under Hot Standby

2012-04-30 Thread Robert Haas
On Mon, Apr 30, 2012 at 10:26 AM, Kevin Grittner kevin.gritt...@wicourts.gov wrote: Robert Haas robertmh...@gmail.com wrote: Simon Riggs si...@2ndquadrant.com wrote: * throw a WARNING if serializable is stated in other cases, and downgrade the request to repeatable read I think this would

Re: [HACKERS] default_transaction_isolation = serializable causes crash under Hot Standby

2012-04-29 Thread Simon Riggs
On Sat, Apr 28, 2012 at 5:56 AM, Kevin Grittner kevin.gritt...@wicourts.gov wrote: But if you set it in the postgresql.conf file, it's not pretty: kevin@kevin-desktop:~$ psql -p 5433 test psql: FATAL:  can not create a serializable snapshot during recovery Ideas? The patch as submitted

Re: [HACKERS] default_transaction_isolation = serializable causes crash under Hot Standby

2012-04-29 Thread Kevin Grittner
Simon Riggs wrote: Kevin Grittner wrote: But if you set it in the postgresql.conf file, it's not pretty: kevin@kevin-desktop:~$ psql -p 5433 test psql: FATAL: can not create a serializable snapshot during recovery Ideas? The patch as submitted doesn't do anything useful for the case

Re: [HACKERS] default_transaction_isolation = serializable causes crash under Hot Standby

2012-04-29 Thread Simon Riggs
On Sun, Apr 29, 2012 at 1:40 PM, Kevin Grittner kevin.gritt...@wicourts.gov wrote: IMHO the desired behaviour would be * prevent default_transaction_isolation = serializable as a default setting when we enter Hot Standby by throwing a FATAL error from the startup process. I can help

Re: [HACKERS] default_transaction_isolation = serializable causes crash under Hot Standby

2012-04-29 Thread Kevin Grittner
Simon Riggs wrote: The only way default_transaction_isolation = serializable would be acceptable when hot_standby = on is if we silently downgrade the isolation level to read committed. That way everything just works, albeit not quite as requested. So I think that's the best way forwards.

Re: [HACKERS] default_transaction_isolation = serializable causes crash under Hot Standby

2012-04-29 Thread Simon Riggs
On Sun, Apr 29, 2012 at 5:54 PM, Kevin Grittner kevin.gritt...@wicourts.gov wrote: Simon Riggs  wrote: The only way default_transaction_isolation = serializable would be acceptable when hot_standby = on is if we silently downgrade the isolation level to read committed. That way everything

Re: [HACKERS] default_transaction_isolation = serializable causes crash under Hot Standby

2012-04-29 Thread Kevin Grittner
Simon Riggs wrote: On Sun, Apr 29, 2012 at 5:54 PM, Kevin Grittner wrote: Simon Riggs wrote: The only way default_transaction_isolation = serializable would be acceptable when hot_standby = on is if we silently downgrade the isolation level to read committed. That way everything just

Re: [HACKERS] default_transaction_isolation = serializable causes crash under Hot Standby

2012-04-29 Thread Robert Haas
On Sun, Apr 29, 2012 at 8:20 AM, Simon Riggs si...@2ndquadrant.com wrote: * prevent default_transaction_isolation = serializable as a default setting when we enter Hot Standby by throwing a FATAL error from the startup process. I can help implement that if we agree. I am strongly disinclined

[HACKERS] default_transaction_isolation = serializable causes crash under Hot Standby

2012-04-27 Thread Robert Haas
When I do this: rhaas=# set default_transaction_isolation = 'serializable'; SET rhaas=# begin; BEGIN rhaas=# select 1; Then I get this: TRAP: FailedAssertion(!(!RecoveryInProgress()), File: predicate.c, Line: 1637) LOG: server process (PID 290) was terminated by signal 6: Abort trap The root

Re: [HACKERS] default_transaction_isolation = serializable causes crash under Hot Standby

2012-04-27 Thread Kevin Grittner
Robert Haas robertmh...@gmail.com wrote: When I do this: rhaas=# set default_transaction_isolation = 'serializable'; SET rhaas=# begin; BEGIN rhaas=# select 1; Then I get this: TRAP: FailedAssertion(!(!RecoveryInProgress()), File: predicate.c, Line: 1637) LOG: server process

Re: [HACKERS] default_transaction_isolation = serializable causes crash under Hot Standby

2012-04-27 Thread Robert Haas
On Fri, Apr 27, 2012 at 10:21 AM, Kevin Grittner kevin.gritt...@wicourts.gov wrote: My first thought was that if we can detect that we are in HS, we should probably throw an ERROR on an attempt to set default_transaction_isolation = 'serializable'. I think that would result in the server

Re: [HACKERS] default_transaction_isolation = serializable causes crash under Hot Standby

2012-04-27 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: Or, maybe there's a way to throw an error when serializable mode is used rather than when it's requested. Couldn't we check and throw an error at the place in transaction startup where default_transaction_isolation is copied to the active variable?

Re: [HACKERS] default_transaction_isolation = serializable causes crash under Hot Standby

2012-04-27 Thread Robert Haas
On Fri, Apr 27, 2012 at 11:02 AM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: Or, maybe there's a way to throw an error when serializable mode is used rather than when it's requested. Couldn't we check and throw an error at the place in transaction startup

Re: [HACKERS] default_transaction_isolation = serializable causes crash under Hot Standby

2012-04-27 Thread Kevin Grittner
Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: Or, maybe there's a way to throw an error when serializable mode is used rather than when it's requested. Couldn't we check and throw an error at the place in transaction startup where default_transaction_isolation

Re: [HACKERS] default_transaction_isolation = serializable causes crash under Hot Standby

2012-04-27 Thread Tom Lane
Kevin Grittner kevin.gritt...@wicourts.gov writes: Tom Lane t...@sss.pgh.pa.us wrote: Couldn't we check and throw an error at the place in transaction startup where default_transaction_isolation is copied to the active variable? Wouldn't that leave users stuck if the postgresql.conf set the

Re: [HACKERS] default_transaction_isolation = serializable causes crash under Hot Standby

2012-04-27 Thread Kevin Grittner
Tom Lane t...@sss.pgh.pa.us wrote: Yeah, it would definitely be nicer if BEGIN; SET TRANSACTION LEVEL would work too. Maybe the place to put the check is where we establish the transaction snapshot. That makes sense, and doesn't seem like it would be hard, from what I recall of that code.

Re: [HACKERS] default_transaction_isolation = serializable causes crash under Hot Standby

2012-04-27 Thread Kevin Grittner
Kevin Grittner wrote: Tom Lane wrote: Yeah, it would definitely be nicer if BEGIN; SET TRANSACTION LEVEL would work too. Maybe the place to put the check is where we establish the transaction snapshot. That makes sense, I'll take a shot at it sometime today, Attached. With a