Sayfalar

27 Ağustos 2020 Perşembe

The transaction has already committed locally, but might not have been replicated to the standby

 Merhabalar Postgres de eğer aşağıdaki hatayı alıyorsanız;  muhtemelen bu sorun sizin Replication name'iniz yanlış olduğu anlamına geliyor.

DETAIL: The transaction has already committed locally, but might not have been replicated to the standby


 

Öncelikle check edelim.

primary DBde;
>postgres=# show synchronous_commit;
 synchronous_commit
--------------------
 on
(1 row)

senkronizasyonumuz açık görünüyor.. değilse off durumunda ise  postgres.conf dosyasından off kısmı on yapalım.

postgres=#
postgres=# select * from pg_stat_replication ;
 pid     usesysid     usename     application_name     client_addr     client_hostname     client_port     backend_start                  backend_xmin     state      sent_lsn     write_lsn     flush_lsn     replay_lsn     write_lag     flush_lag     replay_lag     sync_priority     sync_state     reply_time                    
 ------  -----------  ----------  -------------------  --------------  ------------------  --------------  -----------------------------  ---------------  ---------  -----------  ------------  ------------  -------------  ------------  ------------  -------------  ----------------  -------------  ----------------------------- 
 24330   16388        replikaci   walreceiver          10.150.153.167  (null)              42554           2020-08-27 11:43:52.374787+03  (null)           streaming  0/19010C88   0/19010C88    0/19010C88    0/19010C88     (null)        (null)        (null)         1                 sync           2020-08-27 13:43:42.137884+03 


postgres=# select application_name, sync_state from pg_stat_replication;
 application_name | sync_state
------------------+------------
 walreceiver      | async
(1 row)



postgres=# show synchronous_standby_names;
 synchronous_standby_names
---------------------------
 pgdbtest1

replication application name walreceiver  ise synchronous_standby_names inde aynı isim olması gerekir.  pgdbtest1 ismini değiştireceğiz.

Standby da 

postgres=# show synchronous_commit;
 synchronous_commit
--------------------
 local


olmasını bekleriz.

değişiklik için 

[root@pg_primary_instance]# vi postgresql.conf
#synchronous_standby_names = 'pgdbtest1'
synchronous_standby_names = 'walreceiver'

kayıt edip çıkıyoruz.
[root@pg_primary_instance]# systemctl restart postgresql-12

şimdi işlemlerinize devam edebilirsiniz.. /pgdata/log/ yada İnstance ınızı nereye kurduysanız oradan da log ları kontrol edebilirsiniz?

Hiç yorum yok:

Yorum Gönder