pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: Peter Geoghegan <pg@bowt.ie>
To: pgsql-hackers@postgresql.org
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Delay commit status checks until freezing executes.
Date: Tue, 3 Jan 2023 16:54:33 -0800
Message-ID: <20230104005433.k5aptjbqx75fksfm@awork3.anarazel.de> (raw)
In-Reply-To: <E1pCmsu-001snM-Rr@gemulon.postgresql.org>
References: <E1pCmsu-001snM-Rr@gemulon.postgresql.org>

Hi,

On 2023-01-03 19:23:41 +0000, Peter Geoghegan wrote:
> Delay commit status checks until freezing executes.
> 
> pg_xact lookups are relatively expensive.  Move the xmin/xmax commit
> status checks from the point that freeze plans are prepared to the point
> that they're actually executed.  Otherwise we'll repeat many commit
> status checks whenever multiple successive VACUUM operations scan the
> same pages and decide against freezing each time, which is a waste of
> cycles.
> 
> Oversight in commit 1de58df4, which added page-level freezing.
> 
> Author: Peter Geoghegan <pg@bowt.ie>
> Discussion: https://postgr.es/m/CAH2-WzkZpe4K6qMfEt8H4qYJCKc2R7TPvKsBva7jc9w7iGXQSw@mail.gmail.com

There's some changes from TransactionIdDidCommit() to !TransactionIdDidAbort()
that don't look right to me. If the server crashed while xid X was
in-progress, TransactionIdDidCommit(X) will return false, but so will
TransactionIdDidAbort(X). So besides moving when the check happens you also
changed what's being checked in a more substantial way.


Also, why did you change when MarkBufferDirty() happens? Previously it
happened before we modify the page contents, now after. That's probably fine
(it's the order suggested in transam/README), but seems like a mighty subtle
thing to change at the same time as something unrelated, particularly without
even mentioning it?


Greetings,

Andres Freund





view thread (24+ messages)  latest in thread

Message-ID: <20230104005433.k5aptjbqx75fksfm@awork3.anarazel.de>
Permalink:  ../20230104005433.k5aptjbqx75fksfm@awork3.anarazel.de/
Also on:    postgresql.org/message-id/20230104005433.k5aptjbqx75fksfm@awork3.anarazel.de

 · 

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: andres@anarazel.de, pg@bowt.ie, pgsql-hackers@postgresql.org
  Subject: Re: pgsql: Delay commit status checks until freezing executes.
  In-Reply-To: <20230104005433.k5aptjbqx75fksfm@awork3.anarazel.de>
  References: <E1pCmsu-001snM-Rr@gemulon.postgresql.org> <20230104005433.k5aptjbqx75fksfm@awork3.anarazel.de>

* 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