Re: Synchronizing slots from primary to standby

Поиск
Список
Период
Сортировка
От Bertrand Drouvot
Тема Re: Synchronizing slots from primary to standby
Дата
Msg-id ZgvA1NpJBFzCfXqv@ip-10-97-1-34.eu-west-3.compute.internal
обсуждение исходный текст
Ответ на 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
Hi,

On Tue, Apr 02, 2024 at 07:20:46AM +0000, Zhijie Hou (Fujitsu) wrote:
> I added one test in 040_standby_failover_slots_sync.pl in 0002 patch, which can
> reproduce the data loss issue consistently on my machine.

Thanks!

> It may not reproduce
> in some rare cases if concurrent xl_running_xacts are written by bgwriter, but
> I think it's still valuable if it can verify the fix in most cases.

What about adding a "wait" injection point in LogStandbySnapshot() to prevent
checkpointer/bgwriter to log a standby snapshot? Something among those lines:

       if (AmCheckpointerProcess() || AmBackgroundWriterProcess())
               INJECTION_POINT("bgw-log-standby-snapshot");

And make use of it in the test, something like:

       $node_primary->safe_psql('postgres',
               "SELECT injection_points_attach('bgw-log-standby-snapshot', 'wait');");

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com



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

Предыдущее
От: Andy Fan
Дата:
Сообщение: Re: using extended statistics to improve join estimates
Следующее
От: Bertrand Drouvot
Дата:
Сообщение: Re: Introduce XID age and inactive timeout based replication slot invalidation