RE: Assertion failure in SnapBuildInitialSnapshot()

Поиск
Список
Период
Сортировка
От Hayato Kuroda (Fujitsu)
Тема RE: Assertion failure in SnapBuildInitialSnapshot()
Дата
Msg-id TYAPR01MB58667EC946ADCDC04DD9D186F5CC9@TYAPR01MB5866.jpnprd01.prod.outlook.com
обсуждение исходный текст
Ответ на Re: Assertion failure in SnapBuildInitialSnapshot()  (Masahiko Sawada <sawada.mshk@gmail.com>)
Ответы Re: Assertion failure in SnapBuildInitialSnapshot()  (Amit Kapila <amit.kapila16@gmail.com>)
Список pgsql-hackers
Dear Sawada-san,

Thank you for making the patch! I'm still considering whether this approach is
correct, but I can put a comment to your patch anyway.

```
-    Assert(!already_locked || LWLockHeldByMe(ProcArrayLock));
-
-    if (!already_locked)
-        LWLockAcquire(ProcArrayLock, LW_EXCLUSIVE);
+    Assert(LWLockHeldByMe(ProcArrayLock));
```

In this function, we regard that the ProcArrayLock has been already acquired as
exclusive mode and modify data. I think LWLockHeldByMeInMode() should be used
instead of LWLockHeldByMe().
I confirmed that there is only one caller that uses ReplicationSlotsComputeRequiredXmin(true)
and it acquires exclusive lock correctly, but it can avoid future bug.

Best Regards,
Hayato Kuroda
FUJITSU LIMITED


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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: Time delayed LR (WAS Re: logical replication restrictions)
Следующее
От: Bharath Rupireddy
Дата:
Сообщение: Re: Syncrep and improving latency due to WAL throttling