PostgreSQL - Slony> FATAL ERROR: duplicate key value violates unique sl_nodelock-pkey constraint

Just post it here and help others:

I got this error when we had a break a while ago, and tried to restart the slon replication service, because replication does NOT really replicate data from MASTER to SLAVE:

FATAL  localListenThread: "select "_MY_DATABASE_copy".cleanupNodelock(); insert into "_MY_DATABASE_copy".sl_nodelock values (    1, 0, "pg_catalog".pg_backend_pid()); " - ERROR:  duplicate key value violates unique constraint "sl_nodelock-pkey"
DEBUG2 slon_abort() from pid=xxxx
DEBUG1 slon: shutdown requested
+3
source share
3 answers

Ok, so this is how I fix it, but that does not guarantee that it will work for everyone:

  • Check out the process of using slon. ~# ps aux | grep slon
  • slon .

    ~# ps aux | grep slon
    root      8321     0.0  0.0   6528  1568 pts/2    S+   10:35   0:00 slon MY_SCHEMA dbname=MY_DATABASE user=postgres host=169.1.1.1 password=password
    

, , .

~# kill -9 8321

slon script.


+1

, , ( ), Postgres slon. . :

  • , / node ( , slons slon_kill; ).
  • sl_nodelock     nl_nodeid, / node.
  •   .
+2

, . "slon" . , , "slon" .

+1

Source: https://habr.com/ru/post/1764799/


All Articles