On Fri, Jun 13, 2025 at 6:23 AM Perumal Raj <peruci...@gmail.com> wrote:
>
> Hi Hou zj
>
> I have found some strange issue , but not sure if I am doing anything wrong.
>
> I am able to see logical slot at STANDBY even after promote. 👏

Good to know.

>
> Importantly Logical replication slot is persistance in STANDBYs which already 
> established connection with Primary before logical replication slot creation.
>
> But If I create any new replica(Direct to Primary) after logical replication 
> slot creation, then its not persistance(temporary=true) .
>
>
> New Replica :
>    node   |     slot_name      | slot_type | temporary | active |  plugin  |  
>  database    | failover | synced | restart_lsn | confirmed_flush_lsn |        
> inactive_since
> ----------+--------------------+-----------+-----------+--------+----------+---------------+----------+--------+-------------+---------------------+------------------------------
>  stand-by | kafka_logical_slot | logical   | t         | t      | pgoutput | 
> replica_test | t        | t      | 0/6C000000  |                     | 
> 2025-06-13 00:43:15.61492+00
>
> Old Replica ,
>    node   |     slot_name      | slot_type | temporary | active |  plugin  |  
>  database    | failover | synced | restart_lsn | confirmed_flush_lsn |        
> inactive_since
> ----------+--------------------+-----------+-----------+--------+----------+---------------+----------+--------+-------------+---------------------+-------------------------------
>  stand-by | kafka_logical_slot | logical   | f         | f      | pgoutput | 
> replica_test | t        | t      | 0/6D000060  | 0/6D000098          | 
> 2025-06-13 00:45:11.547671+00
>
>
> Not sure if any Pre-Req missing in my test environment. Or any limitation .

It may be a possibility that the slot is not sync-ready yet  (and thus
not persisted) on new-replica due to primary having older values of
xmin and lsn.  We do not allow persisting a synced slot if the
required WAL or catalog rows for this slot have been removed or are at
risk of removal on standby. The slot will  be persisted in the next
few cycles of automatic slot-synchronization when it is ensured that
source slot's values are safe to be synced to the standby. But to
confirm my diagnosis, please provide this information:

1)
Output of this query on both primary and new-replica (where slot is temporary)
select slot_name, failover, synced, temporary, catalog_xmin,
restart_lsn, confirmed_flush_lsn from pg_replication_slots;

2)
Please check logs on new-replica to see the presence of log:
LOG: could not synchronize replication slot "kafka_logical_slot".

If found, please provide us with both the LOG and DETAIL messages
dumped in the log file.

thanks
Shveta


Reply via email to