Re: Perform streaming logical transactions by background workers and parallel apply

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: sawada(dot)mshk(at)gmail(dot)com
Cc: amit(dot)kapila16(at)gmail(dot)com, houzj(dot)fnst(at)fujitsu(dot)com, wangw(dot)fnst(at)fujitsu(dot)com, smithpb2250(at)gmail(dot)com, shiy(dot)fnst(at)fujitsu(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org, dilipbalaut(at)gmail(dot)com
Subject: Re: Perform streaming logical transactions by background workers and parallel apply
Date: 2023-04-24 02:50:37
Message-ID: 20230424.115037.580310805858449726.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Mon, 24 Apr 2023 10:55:44 +0900, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote in
> While looking at the worker.c, I realized that we have the following
> code in handle_streamed_transaction():
>
> default:
> Assert(false);
> return false; / silence compiler warning /
>
> I think it's better to do elog(ERROR) instead of Assert() as it ends
> up returning false in non-assertion builds, which might cause a
> problem. And it's more consistent with other codes in worker.c. Please
> find an attached patch.

I concur that returning false is problematic.

For assertion builds, Assert typically provides more detailed
information than elog. However, in this case, it wouldn't matter much
since the worker would repeatedly restart even after a server-restart
for the same reason unless cosmic rays are involved. Moreover, the
situation doesn't justify server-restaring, as it would unnecessarily
involve other backends.

In my opinion, it is fine to replace the Assert with an ERROR.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro Horiguchi 2023-04-24 02:55:46 Re: Perform streaming logical transactions by background workers and parallel apply
Previous Message shveta malik 2023-04-24 02:48:24 Re: Support logical replication of DDLs