pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Yura Sokolov <y.sokolov@postgrespro.ru>
To: Matheus Alcantara <matheusssilv97@gmail.com>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Daniil Davydov <3danissimo@gmail.com>
Cc: Álvaro Herrera <alvherre@kurilemu.de>
Cc: Alexandra Wang <alexandra.wang.oss@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: LISTEN/NOTIFY bug: VACUUM sets frozenxid past a xid in async queue
Date: Tue, 2 Sep 2025 10:37:59 +0300
Message-ID: <d186fba0-dc65-4274-aa96-3906bbb2e530@postgrespro.ru> (raw)
In-Reply-To: <CAFY6G8cJm73_MM9SuynZUqtqcaTuepUDgDuvS661oLW7U0dgsg@mail.gmail.com>
References: <CAK98qZ3wZLE-RZJN_Y+TFjiTRPPFPBwNBpBi5K5CU8hUHkzDpw@mail.gmail.com>
	<202508061044.ptcyt7aqsaaa@alvherre.pgsql>
	<DBZN3PVLZ1UW.25XLKCUXYBVXV@gmail.com>
	<CAJDiXgg1ArRB1-6wLtXfVVnQ38P9Y+CDfEc9M2TXiOf_4kfBMg@mail.gmail.com>
	<CAFY6G8cnDOMZCfSvc62vER_9+HOs4EM52XromhOZki+=Ytv2sg@mail.gmail.com>
	<CAJDiXgheRHTnK8RJuBBcF0VjQA83wi81oX2s-GvBV3x+eSwBbA@mail.gmail.com>
	<CAFY6G8dyimRikP3nEK5gqMPnMZe5RTZjFvKvCFLJAvsajxK1fg@mail.gmail.com>
	<CAJDiXgjQZgHLFziG6sS6D5CGYqohMio673ydiRkkffW3WfXmEg@mail.gmail.com>
	<DC7KGTXW3QSG.OZA24HONT78J@gmail.com>
	<CAD21AoCD+HXoc2QZCAS9d8ahDeikNqbnU0i6cQzpMFOEurkPPg@mail.gmail.com>
	<DC8HKDZVIDYG.12H0X267CHMO5@gmail.com>
	<CAFY6G8cJm73_MM9SuynZUqtqcaTuepUDgDuvS661oLW7U0dgsg@mail.gmail.com>

29.08.2025 01:31, Matheus Alcantara пишет:
> On Thu Aug 21, 2025 at 8:14 PM -03, Matheus Alcantara wrote:
>> I'll work on this considering the initial Daniil comments at [1]
>>
>> [1] https://www.postgresql.org/message-id/CAJDiXgg1ArRB1-6wLtXfVVnQ38P9Y%2BCDfEc9M2TXiOf_4kfBMg%40mail.g...
>>
> I've been working on this on the last few days, please see the attached
> patch version.
> 
> In this new version I tried to follow the suggestion from Daniil of
> scanning all pages from tail to head of the async queue.

Since we still need to scan those pages, couldn't we mark finished
transactions as committed/aborted?
This way we may to not hold datfrozenxid for a long time and will allow
both safe clog truncation and safe async queue notification.
More over, most notifications could be marked as completed in
AtCommit_Notify already. So there is a need to recheck a few notifications
that were written but not marked in AtCommit_Notify.

Since AsyncQueueEntry field is used only to check visibility, looks like it
is safe to set it to FrozenTransactionId.

-- 
regards
Yura Sokolov aka funny-falcon





view thread (99+ messages)  latest in thread

Message-ID: <d186fba0-dc65-4274-aa96-3906bbb2e530@postgrespro.ru>
Permalink:  ../d186fba0-dc65-4274-aa96-3906bbb2e530@postgrespro.ru/
Also on:    postgresql.org/message-id/d186fba0-dc65-4274-aa96-3906bbb2e530@postgrespro.ru

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: y.sokolov@postgrespro.ru, matheusssilv97@gmail.com, sawada.mshk@gmail.com, 3danissimo@gmail.com, alvherre@kurilemu.de, alexandra.wang.oss@gmail.com
  Subject: Re: LISTEN/NOTIFY bug: VACUUM sets frozenxid past a xid in async queue
  In-Reply-To: <d186fba0-dc65-4274-aa96-3906bbb2e530@postgrespro.ru>

* 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