pgsql: Fix Coverity issue reported in commit a850be2fe.

From: Amit Kapila <akapila(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix Coverity issue reported in commit a850be2fe.
Date: 2025-09-09 03:28:52
Message-ID: E1uvp2K-001DN9-2J@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix Coverity issue reported in commit a850be2fe.

Address a potential SIGSEGV that may occur when the tablesync worker
attempts to locate a deleted row while applying changes. This situation
arises during conflict detection for update-deleted scenarios.

To prevent this crash, ensure that the operation is errored out early if
the leader apply worker is unavailable. Since the leader worker maintains
the necessary conflict detection metadata, proceeding without it serves no
purpose and risks reporting incorrect conflict type.

In the passing, improve a nearby comment.

Reported by Tom Lane as per Coverity
Author: shveta malik <shveta(dot)malik(at)gmail(dot)com>
Reviewed-by: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Discussion: https://postgr.es/m/334468.1757280992@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5ac3c1ac22cb325844d0bee37f79f2c11931b32e

Modified Files
--------------
src/backend/replication/logical/worker.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Dean Rasheed 2025-09-09 09:48:46 pgsql: Add date and timestamp variants of random(min, max).
Previous Message Melanie Plageman 2025-09-08 21:15:56 pgsql: Add error codes when vacuum discovers VM corruption