Re: Possible dereference null return (src/backend/replication/logical/reorderbuffer.c)

From: Zhihong Yu <zyu(at)yugabyte(dot)com>
To: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Possible dereference null return (src/backend/replication/logical/reorderbuffer.c)
Date: 2021-02-13 20:50:48
Message-ID: CALNJ-vRCNES20LhFnv_Hd_Hn-AskEWeLHcjCi7wtWuFJDRowXQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,
+ (errmsg("BaseSnapshot cant't be setup at point %X/%X",
+ (uint32) (lsn >> 32), (uint32) lsn),
+ errdetail("Top transaction is running.")));

Did you mean this errdetail:

Top transaction is not running.

Cheers

On Sat, Feb 13, 2021 at 12:34 PM Ranier Vilela <ranier(dot)vf(at)gmail(dot)com> wrote:

>
> Em sáb., 13 de fev. de 2021 às 01:07, Zhihong Yu <zyu(at)yugabyte(dot)com>
> escreveu:
>
>> Hi,
>> How about the following patch ?
>>
>> ReorderBufferSetBaseSnapshot() can return a bool to indicate whether the
>> base snapshot is set up.
>>
>> For the call by SnapBuildCommitTxn(), it seems xid is top transaction. So
>> the return value doesn't need to be checked.
>>
> IMO anything else is better than PANIC.
> Anyway, if all fails, reporting an error can contribute to checking where.
>
> Attached a patch suggestion v2.
> 1. SnapBuildProcessChange returns a result of
> ReorderBufferSetBaseSnapshot, so the caller can act accordingly.
> 2. SnapBuildCommitTxn can't ignore a result
> from ReorderBufferSetBaseSnapshot, even if it never fails.
>
> regards,
> Ranier Vilela
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ranier Vilela 2021-02-13 20:59:32 Re: Possible dereference null return (src/backend/replication/logical/reorderbuffer.c)
Previous Message Ranier Vilela 2021-02-13 20:40:38 Re: Possible dereference null return (src/backend/replication/logical/reorderbuffer.c)