RE: Synchronizing slots from primary to standby

Поиск
Список
Период
Сортировка
От Hayato Kuroda (Fujitsu)
Тема RE: Synchronizing slots from primary to standby
Дата
Msg-id TYCPR01MB1207757BB2A32B6815CE1CCE7F53A2@TYCPR01MB12077.jpnprd01.prod.outlook.com
обсуждение исходный текст
Ответ на RE: Synchronizing slots from primary to standby  ("Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>)
Ответы Re: Synchronizing slots from primary to standby  (Amit Kapila <amit.kapila16@gmail.com>)
Список pgsql-hackers
Dear Hou,

Thanks for updating the patch! Here is a comment for it.

```
+        /*
+         * By advancing the restart_lsn, confirmed_lsn, and xmin using
+         * fast-forward logical decoding, we can verify whether a consistent
+         * snapshot can be built. This process also involves saving necessary
+         * snapshots to disk during decoding, ensuring that logical decoding
+         * efficiently reaches a consistent point at the restart_lsn without
+         * the potential loss of data during snapshot creation.
+         */
+        pg_logical_replication_slot_advance(remote_slot->confirmed_lsn,
+                                            found_consistent_point);
+        ReplicationSlotsComputeRequiredLSN();
+        updated_lsn = true;
```

You added them like pg_replication_slot_advance(), but the function also calls
ReplicationSlotsComputeRequiredXmin(false) at that time. According to the related
commit b48df81 and discussions [1], I know it is needed only for physical slots,
but it makes more consistent to call requiredXmin() as well, per [2]:

```
This may be a waste if no advancing is done, but it could also be an
advantage to enforce a recalculation of the thresholds for each
function call.  And that's more consistent with the slot copy, drop
and creation.
```

How do you think?

[1]: https://www.postgresql.org/message-id/20200609171904.kpltxxvjzislidks%40alap3.anarazel.de
[2]: https://www.postgresql.org/message-id/20200616072727.GA2361%40paquier.xyz

Best Regards,
Hayato Kuroda
FUJITSU LIMITED
https://www.fujitsu.com/ 


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

Предыдущее
От: shveta malik
Дата:
Сообщение: Re: Synchronizing slots from primary to standby
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: Introduce XID age and inactive timeout based replication slot invalidation