RE: Perform streaming logical transactions by background workers and parallel apply
От | kuroda.hayato@fujitsu.com |
---|---|
Тема | RE: Perform streaming logical transactions by background workers and parallel apply |
Дата | |
Msg-id | TYAPR01MB5866F35F22C8A8050F2B1C41F5659@TYAPR01MB5866.jpnprd01.prod.outlook.com обсуждение исходный текст |
Ответ на | RE: Perform streaming logical transactions by background workers and parallel apply ("kuroda.hayato@fujitsu.com" <kuroda.hayato@fujitsu.com>) |
Список | pgsql-hackers |
Hi Wang, > 6.a > > It seems that the upper line represents the apply background worker, but I think > last_msg_send_time and last_msg_receipt_time should be null. > Is it like initialization mistake? I checked again about the issue. Attributes worker->last_send_time, worker->last_recv_time, and worker->reply_time are initialized in logicalrep_worker_launch(): ``` ... TIMESTAMP_NOBEGIN(worker->last_send_time); TIMESTAMP_NOBEGIN(worker->last_recv_time); worker->reply_lsn = InvalidXLogRecPtr; TIMESTAMP_NOBEGIN(worker->reply_time); ... ``` And the macro is defined in timestamp.h, and it seems that the values are initialized as PG_INT64_MIN. ``` #define DT_NOBEGIN PG_INT64_MIN #define DT_NOEND PG_INT64_MAX #define TIMESTAMP_NOBEGIN(j) \ do {(j) = DT_NOBEGIN;} while (0) ``` However, in pg_stat_get_subscription(), these values are regarded as null if they are zero. ``` if (worker.last_send_time == 0) nulls[4] = true; else values[4] = TimestampTzGetDatum(worker.last_send_time); if (worker.last_recv_time == 0) nulls[5] = true; else values[5] = TimestampTzGetDatum(worker.last_recv_time); ``` I think above lines are wrong, these values should be compared with PG_INT64_MIN. Best Regards, Hayato Kuroda FUJITSU LIMITED
В списке pgsql-hackers по дате отправления: