Re: Fix two race conditions in processing interrupts

From: shihao zhong <zhong950419(at)gmail(dot)com>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fix two race conditions in processing interrupts
Date: 2026-11-17 01:01:39
Message-ID: CAGRkXqQu7nMQZFW6pRKZWnumV8ajHcoXL_E8cyLSN1uPeZN8kw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Heikki,

Thanks for your patches.

0001 looks good to me.

For 0002

> if (s->blockState == TBLOCK_DEFAULT && s->state == TRANS_DEFAULT)
I think that changed the recovery conflict logic because of the following
code in
postgres.c

> case RECOVERY_CONFLICT_LOCK:
> case RECOVERY_CONFLICT_TABLESPACE:
> case RECOVERY_CONFLICT_SNAPSHOT:
> /*
> * If we aren't in a transaction any longer then ignore.
> */
> if (!IsTransactionOrTransactionBlock())
> return;
>
> report_recovery_conflict(reason);
> return;

And it will eventually become a FATAL which changes the current behavior.
Given
the window is quite small, maybe it is worth mentioning in the commit
message/comment?

Thanks,
Shihao

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bjorn Pagen 2026-11-17 01:10:27 [PATCH] Avoid quadratic rescans in plpgsql_location_to_lineno()
Previous Message Lukas Fittl 2026-11-17 00:51:55 Re: Improve pg_stat_statements scalability