Re: Undocumented error

From: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>
To: Petar Dambovaliev <petar(dot)dambovaliev(at)nextroll(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Undocumented error
Date: 2022-01-14 14:30:31
Message-ID: d4b85229-c2fc-15f1-f048-1c763c86a13e@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 1/14/22 00:02, Petar Dambovaliev wrote:
> Hello,
>
> I am using the libpq to consume a replication slot.
> Very rarely, i would get a very strange error that i can't find any
> information on.
> It is not mentioned in any documentation and i don't know under what
> conditions it triggers.
> Any help is appreciated.
>
> The function i am calling is : `PQgetCopyData`
> the error code is `-1` and the error text is `invalid ordering of
> speculative insertion changes`

Well, that's strange. I see the error message in the source code, but it
kinda implies it's something that should not happen. So either there's a
bug in how we WAL log this stuff, or maybe the decoding is wrong. In any
case it has to be very rare issue, because the code is like this since
2018 and there have been 0 complaints so far.

Which Postgres version is this, exactly? Was the WAL generated by that
same version, or did you update/upgrade recently?

Are you able to reproduce the issue? Do you know what did the
transaction that generated this WAL?

It'd be helpful to see the WAL that trigger this issue - presumably the
error message includes the LSN of the record at which this fails, so use
pg_waldump to dump that segment and show us a sufficiently large chunk
from before that LSN. Not sure how much, because I don't know if you use
subtransactions, how long the transactions are, etc.

regards

--
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2022-01-14 14:35:49 Re: Consistently use the function name CreateCheckPoint instead of CreateCheckpoint in code comments
Previous Message Amit Langote 2022-01-14 14:10:43 Re: generic plans and "initial" pruning