Logical replication - restart_lsn resets back and the status becomes 'unreserved'

From: Indu Akkineni <indu(dot)akkineni(at)gmail(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Logical replication - restart_lsn resets back and the status becomes 'unreserved'
Date: 2024-05-01 21:15:39
Message-ID: CABf8HiE6Msu_w9Dh-B5okJYzTprAZk+UieKjuVCdE1UBKqUC4g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi,

We have a case where the customer does CDC using peer db and logical
replication. For what ever reason, the restart_lsn on the publisher is
reversed and goes so much back that the 'WAL' for that lsn is no longer
available on the disk. At which point the status of the replication slot
becomes 'unreserved' and at the next checkpoint terminates the slot. It
errors out with
` invalidating slot "<<slot_name>>" because its restart_lsn 622D/1E244A08
exceeds max_slot_wal_keep_size"

We do not set max_slot_wal_keep_size, it is at the default of -1.

Any insights on what conditions would restart_lsn actually is reversed and
any insights on how to trace the request coming into the publisher when it
updates pg_replication_Slots?

Thank You
Indu

Browse pgsql-admin by date

  From Date Subject
Next Message Nguyen, Long (IM&T, St. Lucia) 2024-05-02 22:43:37 postgresql in docker to improve security
Previous Message Kashif Zeeshan 2024-05-01 15:40:42 Re: Installation of PostGIS without internet or with limited internet access