pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix one-off bug causing missing commit timestamps for subtransac
Date: Fri, 21 Jan 2022 05:55:40 +0000
Message-ID: <E1nAmtg-0002dC-M3@gemulon.postgresql.org> (raw)

Fix one-off bug causing missing commit timestamps for subtransactions

The logic in charge of writing commit timestamps (enabled with
track_commit_timestamp) for subtransactions had a one-bug bug,
where it would be possible that commit timestamps go missing for the
last subtransaction committed.

While on it, simplify a bit the iteration logic in the loop writing the
commit timestamps, as per suggestions from Kyotaro Horiguchi and Tom
Lane, so as some variable initializations are not part of the loop
itself.

Issue introduced in 73c986a.

Analyzed-by: Alex Kingsborough
Author: Alex Kingsborough, Kyotaro Horiguchi
Discussion: https://postgr.es/m/73A66172-4050-4F2A-B7F1-13508EDA2144@amazon.com
Backpatch-through: 10

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0ffe2975c37473981113fc461990c7533bbcf26d

Modified Files
--------------
src/backend/access/transam/commit_ts.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)



view thread (6+ messages)  latest in thread

Message-ID: <E1nAmtg-0002dC-M3@gemulon.postgresql.org>
Permalink:  ../E1nAmtg-0002dC-M3@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1nAmtg-0002dC-M3@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz
  Subject: Re: pgsql: Fix one-off bug causing missing commit timestamps for subtransac
  In-Reply-To: <E1nAmtg-0002dC-M3@gemulon.postgresql.org>
  References: <E1nAmtg-0002dC-M3@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox