Re: pg_receivewal starting position
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Ronan Dunklau <ronan.dunklau@aiven.io>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>, bharath.rupireddyforpostgres@gmail.com, pgsql-hackers@lists.postgresql.org, sawada.mshk@gmail.com
Date: 2021-09-02T08:37:20Z
Lists: pgsql-hackers
On Thu, Sep 02, 2021 at 10:08:26AM +0200, Ronan Dunklau wrote: > I could see the use for sending active_pid for use within pg_basebackup: at > least we could fail early if the slot is already in use. But at the same time, > maybe it won't be in use anymore once we need it. There is no real concurrent protection with this design. You could read that the slot is not active during READ_REPLICATION_SLOT just to find out after in the process of pg_basebackup streaming WAL that it became in use in-between. And the backend-side protections would kick in at this stage. Hmm. The logic doing the decision-making with pg_receivewal may become more tricky when it comes to pg_replication_slots.wal_status, max_slot_wal_keep_size and pg_replication_slots.safe_wal_size. The number of cases we'd like to consider impacts directly the amount of data send through READ_REPLICATION_SLOT. That's not really different than deciding of a failure, a success or a retry with active_pid at an earlier or a later stage of a base backup. pg_receivewal, on the contrary, can just rely on what the backend tells when it begins streaming. So I'd prefer keeping things simple and limit the number of fields a minimum for this command. -- Michael
Commits
-
Add TAP test for pg_receivewal with timeline switch
- 0f9b9938a036 15.0 landed
-
Speed up TAP tests of pg_receivewal
- d680992af540 15.0 landed
-
Allow pg_receivewal to stream from a slot's restart LSN
- f61e1dd2cee6 15.0 landed
-
Add replication command READ_REPLICATION_SLOT
- b4ada4e19fd7 15.0 landed
-
doc: Describe calculation method of streaming start for pg_receivewal
- 438d467a5241 10.19 landed
- e6c5f1b45265 11.14 landed
- fb1aa489e481 12.9 landed
- 7c949f1b3aab 13.5 landed
- affec9f6a2de 14.1 landed
- 1e9475694b0a 15.0 landed
-
Add PostgresNode::command_fails_like()
- de1d4fef71cb 15.0 landed