Problem with txid_snapshot_in/out() functionality

From: Jan Wieck <jan(at)wi3ck(dot)info>
To: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Problem with txid_snapshot_in/out() functionality
Date: 2014-04-11 21:07:29
Message-ID: 53485991.1090505@wi3ck.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hackers,

the Slony team has been getting seldom reports of a problem with the
txid_snapshot data type.

The symptom is that a txid_snapshot on output lists the same txid
multiple times in the xip list part of the external representation. This
string is later rejected by txid_snapshot_in() when trying to determine
if a particular txid is visible in that snapshot using the
txid_visible_in_snapshot() function.

I was not yet able to reproduce this problem in a lab environment. It
might be related to subtransactions and/or two phase commit (at least
one user is using both of them). The reported PostgreSQL version
involved in that case was 9.1.

At this point I would find it extremely helpful to "sanitize" the
external representation in txid_snapshot_out() while emitting some
NOTICE level logging when this actually happens. I am aware that this
does amount to a functional change for a back release, but considering
that the _out() generated external representation of an existing binary
datum won't pass the type's _in() function, I argue that such change is
warranted. Especially since this problem could possibly corrupt a dump.

Comments?

Jan

--
Jan Wieck
Senior Software Engineer
http://slony.info

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Florian Pflug 2014-04-11 22:18:28 Re: [PATCH] Negative Transition Aggregate Functions (WIP)
Previous Message Greg Stark 2014-04-11 20:47:20 Re: Problem with displaying "wide" tables in psql