RE: persist logical slots to disk during shutdown checkpoint - Mailing list pgsql-hackers

From Hayato Kuroda (Fujitsu)
Subject RE: persist logical slots to disk during shutdown checkpoint
Date
Msg-id TYAPR01MB586612783A24C51A16831713F5E0A@TYAPR01MB5866.jpnprd01.prod.outlook.com
Whole thread Raw
In response to Re: persist logical slots to disk during shutdown checkpoint  (vignesh C <vignesh21@gmail.com>)
List pgsql-hackers
Dear hackers,

I also tested for logical slots on the physical standby. PSA the script.
confirmed_flush_lsn for such slots were successfully persisted.

# Topology

In this test nodes are connected each other.

node1 --(physical replication)-->node2--(logical replication)-->node3

# Test method

An attached script did following steps

1. constructed above configurations
2. Inserted data on node1
3. read confirmed_flush_lsn on node2 (a)
4. restarted node2
5. read confirmed_flush_lsn again on node2 (b)
6. compare (a) and (b)

# result

Before patching, (a) and (b) were different value, which meant that logical
slots on physical standby were not saved at shutdown.

```
slot_name | confirmed_flush_lsn 
-----------+---------------------
 sub       | 0/30003E8
(1 row)

waiting for server to shut down.... done
server stopped
waiting for server to start.... done
server started
 slot_name | confirmed_flush_lsn 
-----------+---------------------
 sub       | 0/30000D8
(1 row)
```

After patching, (a) and (b) became the same value. The v4 patch worked well even
if the node is physical standby.

```
slot_name | confirmed_flush_lsn 
-----------+---------------------
 sub       | 0/30003E8
(1 row)

waiting for server to shut down.... done
server stopped
waiting for server to start.... done
server started
 slot_name | confirmed_flush_lsn 
-----------+---------------------
 sub       | 0/30003E8
(1 row)
```

Best Regards,
Hayato Kuroda
FUJITSU LIMITED


Attachment

pgsql-hackers by date:

Previous
From: Aleksander Alekseev
Date:
Subject: Re: [PATCH v1] PQputCopyEnd never returns 0, fix the inaccurate comment
Next
From: Pavel Stehule
Date:
Subject: Re: proposal: psql: show current user in prompt