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

Поиск
Список
Период
Сортировка
От Hayato Kuroda (Fujitsu)
Тема RE: Perform streaming logical transactions by background workers and parallel apply
Дата
Msg-id TYAPR01MB5866E0165FBBFEA66436E3E6F53B9@TYAPR01MB5866.jpnprd01.prod.outlook.com
обсуждение исходный текст
Ответ на RE: Perform streaming logical transactions by background workers and parallel apply  ("Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>)
Список pgsql-hackers
> While testing yours, I found that the leader apply worker has been crashed in the
> following case.
> I will dig the failure more, but I reported here for records.

I found a reason why the leader apply worker crasehes.
In parallel_apply_free_worker() the leader sends the pending message to parallel apply worker:

```
+               /*
+                * Resend the pending message to parallel apply worker to cleanup the
+                * queue. Note that parallel apply worker will just ignore this message
+                * as it has already handled this message while applying spooled
+                * messages.
+                */
+               result = shm_mq_send(winfo->mq_handle, strlen(winfo->pending_msg),
+                                                        winfo->pending_msg, false, true);
```

...but the message length should not be calucarete by strlen() because the logicalrep message has '\0'.
PSA the patch to fix it. It can be applied on v42 patch set.


Best Regards,
Hayato Kuroda
FUJITSU LIMITED


Вложения

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

Предыдущее
От: vignesh C
Дата:
Сообщение: Re: Support logical replication of DDLs
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: confirmed_flush_lsn shows LSN of the data that has not yet been received by the logical subscriber.