# Synchronous replication - PostgreSQL 17

**URL:** <https://forums.percona.com/t/synchronous-replication-postgresql-17/37942>\
**Category:** Uncategorized\
**Created:** [May 14, 2025, 2:18pm UTC](https://forums.percona.com/t/synchronous-replication-postgresql-17/37942 "2025-05-14T14:18:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Umashankar\_Balasubra](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/umashankar_balasubra/32/20897_2.png) [@Umashankar\_Balasubra](https://forums.percona.com/u/Umashankar_Balasubra)\
**Post date:** [May 14, 2025, 2:18pm UTC](https://forums.percona.com/t/synchronous-replication-postgresql-17/37942/1 "2025-05-14T14:18:22Z")

</div>

In synchronous replication, if Primary (pgnode1) goes down, then pgnode 2 (standby) becomes primary and write operations are hung in pgnode2 with below error DETAIL: The transaction has already committed locally, but might not have been replicated to the standby. We are using Patroni and etcd, PostgreSQL17.  
synchronous\_mode: true  
synchronous\_mode\_strict: false  
synchronous\_commit: ‘on’  
synchronous\_standby\_names: ‘pgnode1’

How to resolve this issue?

---

<div class="post-metadata">

**Author:** ![Robert\_Bernier](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/robert_bernier/32/1367_2.png) [@Robert\_Bernier](https://forums.percona.com/u/Robert_Bernier)\
**Post date:** [May 14, 2025, 3:13pm UTC](https://forums.percona.com/t/synchronous-replication-postgresql-17/37942/2 "2025-05-14T15:13:03Z")

</div>

Hi,

There’s two ways to solve your problem i.e. the easy way and the hard way 🙂

**Hard way** : Since the transaction to the REPLICA has not been received you will need to tell the service to ignore it by identifying the LSN and “skipping it”. Refer to the documentation for [pg\_replication\_slot\_advance](https://www.postgresql.org/docs/current/functions-admin.html#FUNCTIONS-REPLICATION)

**Easy way** : update [synchronous\_commit](https://www.postgresql.org/docs/current/runtime-config-wal.html#GUC-SYNCHRONOUS-COMMIT) i.e. use either **remote\_apply** or **remote\_write**

```auto
-- execute on PRIMARY 
alter system set synchronous_commit=remote_write
select pg_reload_conf();

```
