Re: Replication sequence

Поиск
Список
Период
Сортировка
От Paolo Saudin
Тема Re: Replication sequence
Дата
Msg-id CADtZQgmv-5Z46eNdLKz-duG9MYZUgkw41P5H_mHvsQ=L1cKkAQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Replication sequence  (Loles <lolesft@gmail.com>)
Список pgsql-general
Il giorno lun 15 feb 2021 alle ore 20:40 Loles <lolesft@gmail.com> ha scritto:
One thing is the number of records in the table and another is the current value of the sequence.

Execute:

select max (field) from bobo.menu_pages;

In both master and slave server.

What give you back?

"field" is the data that belongs to the sequence.



El lun., 15 feb. 2021 18:55, Paolo Saudin <paolosaudin@gmail.com> escribió:
Hi all,
I have two servers, a primary and a secondary one with a streaming replica setup.
Today I noticed that some sequences are not lined-up, the replica ones are well ahead, while the records number is the same. How is it possible?

Thanks,
Paolo

--
-- primary server
--
postgres@db-srv1:~$ psql
psql (9.5.19)
cf-db-srv1:5432 postgres@rete_llpp=# SELECT last_value FROM bobo.menu_pages_mp_id_seq;
┌────────────┐
│ last_value │
├────────────┤
│         74 │
└────────────┘
  cf-db-srv1:5432 postgres@rete_llpp=# select count(*) from bobo.menu_pages;
┌───────┐
│ count │
├───────┤
│    74 │
└───────┘

--
-- replica server
--
postgres@db-srv2:~$ psql
psql (9.5.24)
cf-db-srv2:5433 postgres@rete_llpp=# SELECT last_value FROM bobo.menu_pages_mp_id_seq;
┌────────────┐
│ last_value │
├────────────┤
│        105 │
└────────────┘
cf-db-srv2:5433 postgres@rete_llpp=# select count(*) from bobo.menu_pages;
┌───────┐
│ count │
├───────┤
│    74 │
└───────┘


Hi, I checked and the number of records are identical,

cf-db-srv1:5432 postgres@rete_llpp=# select max(mp_id) from bobo.menu_pages;
┌─────┐
│ max │
├─────┤
│  74 │
└─────┘

cf-db-srv2:5433 postgres@rete_llpp=# select max(mp_id) from bobo.menu_pages;
┌─────┐
│ max │
├─────┤
│  74 │
└─────┘
Thank you,
Paolo



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

Предыдущее
От: Abdul Qoyyuum
Дата:
Сообщение: Re: Set a specific database to log_statement='ddl' but others to be log_statement='all'
Следующее
От: Abdul Qoyyuum
Дата:
Сообщение: Re: ALTER ROLE ... SET in current database only