Re: replication cleanup code incorrect way to use of HTAB HASH_REMOVE ?

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Peter Smith <smithpb2250(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: replication cleanup code incorrect way to use of HTAB HASH_REMOVE ?
Date: 2021-03-21 09:54:44
Message-ID: CAA4eK1K+VZ1PwKj-Eo9UkdbcasjXu1ZrRA5WNkSZDpt4mGTZtw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Mar 20, 2021 at 12:54 PM Peter Smith <smithpb2250(at)gmail(dot)com> wrote:
>
> PSA my patch to correct this by firstly doing a HASH_FIND, then only
> HASH_REMOVE after we've finished using the ent.
>

Why can't we keep using HASH_REMOVE as it is but get the output (entry
found or not) in the last parameter of hash_search API and then
perform Assert based on that? See similar usage in reorderbuffer.c and
rewriteheap.c.

--
With Regards,
Amit Kapila.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2021-03-21 10:38:00 Re: Replication slot stats misgivings
Previous Message Amit Kapila 2021-03-21 09:47:00 Re: Logical Replication vs. 2PC