Re: Fix slot's xmin advancement and subxact's lost snapshots in decoding.

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Arseny Sher <a(dot)sher(at)postgrespro(dot)ru>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fix slot's xmin advancement and subxact's lost snapshots in decoding.
Date: 2018-04-17 03:17:28
Message-ID: 20180417031728.GC4998@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Apr 08, 2018 at 08:46:04AM +0300, Arseny Sher wrote:
> I've discovered a couple of bugs in logical decoding code, both leading
> to incorrect decoding results in somewhat rare cases. First, xmin of
> slots is advanced too early. This affects the results only when
> interlocking allows to perform DDL concurrently with looking at the
> schema. In fact, I was not aware about such DDL until at
> https://www.postgresql.org/message-id/flat/87tvu0p0jm(dot)fsf%40ars-thinkpad#87tvu0p0jm(dot)fsf(at)ars-thinkpad
> I raised this question and Andres pointed out ALTER of composite
> types. Probably there are others, I am not sure; it would be interesting
> to know them.
>
> Another problem is that new snapshots are never queued to known
> subxacts. It means decoding results can be wrong if toplevel doesn't
> write anything while subxact does.

Most people are recovering from the last commit fest, where many patches
have been discussed and dealt with. I have not looked in details at
your patch so I cannot say is legit or not, but for now I would
recommend to register this patch to the next commit fest under the
category "Bug Fixes" so as it does not fall into the cracks:
https://commitfest.postgresql.org/18/

I have added an entry to the open items in the section for older bugs:
https://wiki.postgresql.org/wiki/PostgreSQL_11_Open_Items#Older_Bugs
However this list tends to be... Er... Ignored.

> Please see detailed description of the issues, tests which reproduce
> them and fixes in the attached patch.

Those are always good things to have in a patch.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2018-04-17 03:28:58 Re: SHOW ALL does not honor pg_read_all_settings membership
Previous Message Michael Paquier 2018-04-17 03:12:03 Re: Proposal: Adding json logging