Sequence last value is different among primary and secondary

From: Kenny Bachman <kenny(dot)bachman17(at)gmail(dot)com>
To: Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Sequence last value is different among primary and secondary
Date: 2022-11-15 08:24:51
Message-ID: CAC0w7LJszznfQ7FmgPzFQBd=4t5y23cd0T1iU_D4g0+PG0X08w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hello Team,

I got a weird situation about the sequence value in PG 14.5 (rhel 8.6). The
sequence's last value is different between primary and secondary nodes.

This sequence output belongs to the PRIMARY node:

SELECT * FROM "ACCOUNT_ITEM_SEQ" ;
last_value | log_cnt | is_called
------------+---------+-----------
105485 | 31 | t

This output belongs to the SECONDARY node:

SELECT * FROM "ACCOUNT_ITEM_SEQ" ;
last_value | log_cnt | is_called
------------+---------+-----------
105516 | 0 | t

*There is no replication gap or lag between the nodes.*
What is the reason behind this difference?

Thank you for your help and guidance in advance.
Will

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Paul Smith 2022-11-15 08:48:09 Re: Sequence last value is different among primary and secondary
Previous Message Rui DeSousa 2022-11-12 18:08:26 Re: How to test replication without doing a failover