Code Monkey home page Code Monkey logo

Comments (6)

mnencia avatar mnencia commented on July 20, 2024 1

Correct. We should generally drop any HA replication slot on a standby node if it has xmin or catalog_xmin set.

from cloudnative-pg.

mnencia avatar mnencia commented on July 20, 2024

This is an interesting issue. The main on a standby slot should not have been initialized, so it happened when node 3 was primary. AFAIK the only way to clear the xmin field is to delete the replication slot. I think the operator should do it automatically in this case.

from cloudnative-pg.

mnencia avatar mnencia commented on July 20, 2024

I confirm the bug. If hot_standby_feedback is on, the xmin remains set for the slots on the previous primary, which stops the vacuum. We need to drop the slot and recreate it.

from cloudnative-pg.

smiyc avatar smiyc commented on July 20, 2024

great!
so the workaround in my case is
select pg_drop_replication_slot('_cnpg_keycloak_5');
on keycloak-3?

from cloudnative-pg.

smiyc avatar smiyc commented on July 20, 2024

I tested on a demo cluster and it worked

postgres=# select * from pg_replication_slots ;
    slot_name     | plugin | slot_type | datoid | database | temporary | active | active_pid |   xmin   | catalog_xmin | restart_lsn  | confirmed_flush_lsn | wal_status | safe_wal_size | two_phase | conflicting 
------------------+--------+-----------+--------+----------+-----------+--------+------------+----------+--------------+--------------+---------------------+------------+---------------+-----------+-------------
 _cnpg_keycloak_5 |        | physical  |        |          | f         | f      |            | 58198033 |              | 824/5A000000 |                     | reserved   | 9048875335680 | f         | 
(1 row)



postgres=# select pg_drop_replica

postgres=# select pg_drop_replication_slot('_cnpg_keycloak_5');
 pg_drop_replication_slot 
--------------------------
 
(1 row)

postgres=# select * from pg_replication_slots ;
    slot_name     | plugin | slot_type | datoid | database | temporary | active | active_pid | xmin | catalog_xmin | restart_lsn  | confirmed_flush_lsn | wal_status | safe_wal_size | two_phase | conflicting 
------------------+--------+-----------+--------+----------+-----------+--------+------------+------+--------------+--------------+---------------------+------------+---------------+-----------+-------------
 _cnpg_keycloak_5 |        | physical  |        |          | f         | f      |            |      |              | 824/5A000000 |                     | reserved   | 9048875335680 | f         | 

from cloudnative-pg.

smiyc avatar smiyc commented on July 20, 2024

Workaround works!

2c7e8c56-fecc-4659-9eca-74442f870bb9

c06e574a-7fdc-47f3-a244-2f0045eb52fe

90aab908-5b18-4b06-b94a-819b36549b28

410c2f98-6c8f-48a0-b0f0-0664405d1160

fe180b89-4c87-48df-8c2a-85e4163f0ad6

from cloudnative-pg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.