Re: replication cleanup code incorrect way to use of HTAB HASH_REMOVE ? - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: replication cleanup code incorrect way to use of HTAB HASH_REMOVE ?
Date
Msg-id CAA4eK1K+VZ1PwKj-Eo9UkdbcasjXu1ZrRA5WNkSZDpt4mGTZtw@mail.gmail.com
Whole thread Raw
In response to replication cleanup code incorrect way to use of HTAB HASH_REMOVE ?  (Peter Smith <smithpb2250@gmail.com>)
Responses Re: replication cleanup code incorrect way to use of HTAB HASH_REMOVE ?  (Peter Smith <smithpb2250@gmail.com>)
List pgsql-hackers
On Sat, Mar 20, 2021 at 12:54 PM Peter Smith <smithpb2250@gmail.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.



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Logical Replication vs. 2PC
Next
From: Amit Kapila
Date:
Subject: Re: Replication slot stats misgivings