Re: Forget close an open relation in ReorderBufferProcessTXN()

Поиск
Список
Период
Сортировка
От Amit Langote
Тема Re: Forget close an open relation in ReorderBufferProcessTXN()
Дата
Msg-id CA+HiwqHthnh2G8XFBV1++JyP34ir7OGSznYPV2uMWsQK40-JoA@mail.gmail.com
обсуждение исходный текст
Ответ на RE: Forget close an open relation in ReorderBufferProcessTXN()  ("osumi.takamichi@fujitsu.com" <osumi.takamichi@fujitsu.com>)
Ответы RE: Forget close an open relation in ReorderBufferProcessTXN()  ("osumi.takamichi@fujitsu.com" <osumi.takamichi@fujitsu.com>)
Re: Forget close an open relation in ReorderBufferProcessTXN()  (Amit Kapila <amit.kapila16@gmail.com>)
Список pgsql-hackers
On Fri, May 21, 2021 at 3:55 PM osumi.takamichi@fujitsu.com
<osumi.takamichi@fujitsu.com> wrote:
> On Thursday, May 20, 2021 9:59 PM Amit Langote <amitlangote09@gmail.com> wrote:
> > Here are updated/divided patches.
> Thanks for your updates.
>
> But, I've detected segmentation faults caused by the patch,
> which can happen during 100_bugs.pl in src/test/subscription.
> This happens more than one in ten times.
>
> This problem would be a timing issue and has been introduced by v3 already.
> I used v5 for HEAD also and reproduced this failure, while
> OSS HEAD doesn't reproduce this, even when I executed 100_bugs.pl 200 times in a tight loop.
> I aligned the commit id 4f586fe2 for all check. Below logs are ones I got from v3.
>
> My first guess of the cause is that between the timing to get an entry from hash_search() in get_rel_sync_entry()
> and to set the map by convert_tuples_by_name() in maybe_send_schema(), we had invalidation message,
> which tries to free unset descs in the entry ?

Hmm, maybe get_rel_syn_entry() should explicitly set map to NULL when
first initializing an entry.  It's possible that without doing so, the
map remains set to a garbage value, which causes the invalidation
callback that runs into such partially initialized entry to segfault
upon trying to deference that garbage pointer.

I've tried that in the attached v6 patches.  Please check.

-- 
Amit Langote
EDB: http://www.enterprisedb.com

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: "osumi.takamichi@fujitsu.com"
Дата:
Сообщение: RE: Forget close an open relation in ReorderBufferProcessTXN()
Следующее
От: Kyotaro Horiguchi
Дата:
Сообщение: Re: Race condition in recovery?