Re: rolled back transactions logging - Mailing list pgsql-general

From Jim Nasby
Subject Re: rolled back transactions logging
Date
Msg-id 553AB8BB.9080601@BlueTreble.com
Whole thread Raw
In response to rolled back transactions logging  (Andrey Lizenko <lizenko79@gmail.com>)
List pgsql-general
On 4/23/15 5:49 PM, Andrey Lizenko wrote:
> Can VACUUM be a reason of xact_rollback increasing?

I don't think so, not without generating some kind of error.

What could be happening is plpgsql catching exceptions. A BEGIN block
with an EXCEPTION handle creates an implicit subtransaction (savepoint),
and if you catch the exception it's going to do the equivalent of
ROLLBACK TO savepoint. That might be counted as a rollback. More
importantly...

> Server version is 9.2.4
>
> P.S,
> Root problem is the number of wal files,  it raised up significantly
> (more than 4 times) with the same workload and I do not know why.

... plpgsql catching a lot of exceptions in blocks that have modified
data will definitely create WAL. To be clear, the WAL was generated by
whatever DML you did inside the block, but if you trap an exception and
then loop back again and again and again... lots of extra WAL.
--
Jim Nasby, Data Architect, Blue Treble Consulting
Data in Trouble? Get it in Treble! http://BlueTreble.com


pgsql-general by date:

Previous
From: Chris Mair
Date:
Subject: Re: Invalid memory alloc
Next
From: Dorian Hoxha
Date:
Subject: Re: Streaming-SQL Database PipelineDB (Based on PostgreSQL 9.4) - Available in Beta