Re: Restrict copying of invalidated replication slots

2025-04-04 Thread Masahiko Sawada
On Wed, Apr 2, 2025 at 2:58 PM Masahiko Sawada wrote: > > On Tue, Mar 18, 2025 at 2:28 AM Shlok Kyal wrote: > > > > On Mon, 17 Mar 2025 at 22:57, Masahiko Sawada wrote: > > > > > > On Sun, Mar 9, 2025 at 11:16 PM Shlok Kyal > > > wrote: > > > > > > > > On Fri, 28 Feb 2025 at 08:56, Amit Kapila

Re: Restrict copying of invalidated replication slots

2025-04-02 Thread Masahiko Sawada
On Tue, Mar 18, 2025 at 2:28 AM Shlok Kyal wrote: > > On Mon, 17 Mar 2025 at 22:57, Masahiko Sawada wrote: > > > > On Sun, Mar 9, 2025 at 11:16 PM Shlok Kyal wrote: > > > > > > On Fri, 28 Feb 2025 at 08:56, Amit Kapila wrote: > > > > > > > > On Fri, Feb 28, 2025 at 5:10 AM Masahiko Sawada > >

Re: Restrict copying of invalidated replication slots

2025-03-18 Thread Shlok Kyal
On Mon, 17 Mar 2025 at 22:57, Masahiko Sawada wrote: > > On Sun, Mar 9, 2025 at 11:16 PM Shlok Kyal wrote: > > > > On Fri, 28 Feb 2025 at 08:56, Amit Kapila wrote: > > > > > > On Fri, Feb 28, 2025 at 5:10 AM Masahiko Sawada > > > wrote: > > > > > > > > On Thu, Feb 27, 2025 at 12:52 AM Amit Kap

Re: Restrict copying of invalidated replication slots

2025-03-18 Thread Shlok Kyal
On Mon, 17 Mar 2025 at 12:18, Amit Kapila wrote: > > On Mon, Mar 10, 2025 at 11:46 AM Shlok Kyal wrote: > > > > > > I tried to reproduce the scenario described using the following steps: > > > > Here are the steps: > > > > 1. set max_replication_slots = 2 > > > > 2. create two logical replication

Re: Restrict copying of invalidated replication slots

2025-03-17 Thread Masahiko Sawada
On Sun, Mar 9, 2025 at 11:16 PM Shlok Kyal wrote: > > On Fri, 28 Feb 2025 at 08:56, Amit Kapila wrote: > > > > On Fri, Feb 28, 2025 at 5:10 AM Masahiko Sawada > > wrote: > > > > > > On Thu, Feb 27, 2025 at 12:52 AM Amit Kapila > > > wrote: > > > > > > > > On Thu, Feb 27, 2025 at 10:47 AM Masa

Re: Restrict copying of invalidated replication slots

2025-03-16 Thread Amit Kapila
On Mon, Mar 10, 2025 at 11:46 AM Shlok Kyal wrote: > > > I tried to reproduce the scenario described using the following steps: > > Here are the steps: > > 1. set max_replication_slots = 2 > > 2. create two logical replication slot, lets say slot1 and slot2. drop > the first slot (slot1). > > 3. N

Re: Restrict copying of invalidated replication slots

2025-03-09 Thread Shlok Kyal
On Fri, 28 Feb 2025 at 08:56, Amit Kapila wrote: > > On Fri, Feb 28, 2025 at 5:10 AM Masahiko Sawada wrote: > > > > On Thu, Feb 27, 2025 at 12:52 AM Amit Kapila > > wrote: > > > > > > On Thu, Feb 27, 2025 at 10:47 AM Masahiko Sawada > > > wrote: > > > > > > > > On Tue, Feb 25, 2025 at 7:33 PM

Re: Restrict copying of invalidated replication slots

2025-02-28 Thread Masahiko Sawada
On Thu, Feb 27, 2025 at 7:26 PM Amit Kapila wrote: > > On Fri, Feb 28, 2025 at 5:10 AM Masahiko Sawada wrote: > > > > On Thu, Feb 27, 2025 at 12:52 AM Amit Kapila > > wrote: > > > > > > On Thu, Feb 27, 2025 at 10:47 AM Masahiko Sawada > > > wrote: > > > > > > > > On Tue, Feb 25, 2025 at 7:33 

Re: Restrict copying of invalidated replication slots

2025-02-27 Thread Amit Kapila
On Fri, Feb 28, 2025 at 5:10 AM Masahiko Sawada wrote: > > On Thu, Feb 27, 2025 at 12:52 AM Amit Kapila wrote: > > > > On Thu, Feb 27, 2025 at 10:47 AM Masahiko Sawada > > wrote: > > > > > > On Tue, Feb 25, 2025 at 7:33 PM Amit Kapila > > > wrote: > > > > > > > > AFAICU, InvalidateObsoleteRep

Re: Restrict copying of invalidated replication slots

2025-02-27 Thread Masahiko Sawada
On Thu, Feb 27, 2025 at 12:52 AM Amit Kapila wrote: > > On Thu, Feb 27, 2025 at 10:47 AM Masahiko Sawada > wrote: > > > > On Tue, Feb 25, 2025 at 7:33 PM Amit Kapila wrote: > > > > > > AFAICU, InvalidateObsoleteReplicationSlots() is not serialized with > > > this operation. So, isn't it possibl

Re: Restrict copying of invalidated replication slots

2025-02-27 Thread Amit Kapila
On Thu, Feb 27, 2025 at 10:47 AM Masahiko Sawada wrote: > > On Tue, Feb 25, 2025 at 7:33 PM Amit Kapila wrote: > > > > AFAICU, InvalidateObsoleteReplicationSlots() is not serialized with > > this operation. So, isn't it possible that the source slot exists at > > the later position in Replication

Re: Restrict copying of invalidated replication slots

2025-02-26 Thread Masahiko Sawada
On Tue, Feb 25, 2025 at 7:33 PM Amit Kapila wrote: > > On Tue, Feb 25, 2025 at 11:21 PM Masahiko Sawada > wrote: > > > > On Tue, Feb 25, 2025 at 2:36 AM Amit Kapila wrote: > > > > > > > > > > > Scenario-3: the source gets invalidated after creating the copied slot > > > > (i.e. after create_log

Re: Restrict copying of invalidated replication slots

2025-02-25 Thread Amit Kapila
On Tue, Feb 25, 2025 at 11:21 PM Masahiko Sawada wrote: > > On Tue, Feb 25, 2025 at 2:36 AM Amit Kapila wrote: > > > > > > > > Scenario-3: the source gets invalidated after creating the copied slot > > > (i.e. after create_logical/physical_replication_slot()). In this case, > > > since the newly

Re: Restrict copying of invalidated replication slots

2025-02-25 Thread Masahiko Sawada
On Mon, Feb 24, 2025 at 10:09 PM Shlok Kyal wrote: > > On Tue, 25 Feb 2025 at 01:03, Masahiko Sawada wrote: > > > > I've checked if this issue exists also on v15 or older, but IIUC it > > doesn't exist, fortunately. Here is the summary: > > > > Scenario-1: the source gets invalidated before the c

Re: Restrict copying of invalidated replication slots

2025-02-25 Thread Masahiko Sawada
On Tue, Feb 25, 2025 at 2:36 AM Amit Kapila wrote: > > On Tue, Feb 25, 2025 at 1:03 AM Masahiko Sawada wrote: > > > > I've checked if this issue exists also on v15 or older, but IIUC it > > doesn't exist, fortunately. Here is the summary: > > > > Scenario-1: the source gets invalidated before the

Re: Restrict copying of invalidated replication slots

2025-02-25 Thread Amit Kapila
On Tue, Feb 25, 2025 at 1:03 AM Masahiko Sawada wrote: > > I've checked if this issue exists also on v15 or older, but IIUC it > doesn't exist, fortunately. Here is the summary: > > Scenario-1: the source gets invalidated before the copy function > fetches its contents for the first time. In this

Re: Restrict copying of invalidated replication slots

2025-02-24 Thread Shlok Kyal
On Tue, 25 Feb 2025 at 01:03, Masahiko Sawada wrote: > > On Mon, Feb 24, 2025 at 3:06 AM Shlok Kyal wrote: > > > > On Sat, 22 Feb 2025 at 04:49, Masahiko Sawada wrote: > > > > > > On Fri, Feb 21, 2025 at 4:30 AM Shlok Kyal > > > wrote: > > > > > > > > On Fri, 21 Feb 2025 at 01:14, Masahiko Saw

Re: Restrict copying of invalidated replication slots

2025-02-24 Thread Masahiko Sawada
On Mon, Feb 24, 2025 at 3:06 AM Shlok Kyal wrote: > > On Sat, 22 Feb 2025 at 04:49, Masahiko Sawada wrote: > > > > On Fri, Feb 21, 2025 at 4:30 AM Shlok Kyal wrote: > > > > > > On Fri, 21 Feb 2025 at 01:14, Masahiko Sawada > > > wrote: > > > > > > > > On Wed, Feb 19, 2025 at 3:46 AM Shlok Kyal

Re: Restrict copying of invalidated replication slots

2025-02-24 Thread Shlok Kyal
On Sun, 23 Feb 2025 at 06:46, Peter Smith wrote: > > Some review comments for patch v2-0001. > > == > Commit message > > 1. > Currently we can copy an invalidated logical and physical replication slot > using functions 'pg_copy_logical_replication_slot' and > 'pg_copy_physical_replication_slot

Re: Restrict copying of invalidated replication slots

2025-02-24 Thread Shlok Kyal
On Sat, 22 Feb 2025 at 04:49, Masahiko Sawada wrote: > > On Fri, Feb 21, 2025 at 4:30 AM Shlok Kyal wrote: > > > > On Fri, 21 Feb 2025 at 01:14, Masahiko Sawada wrote: > > > > > > On Wed, Feb 19, 2025 at 3:46 AM Shlok Kyal > > > wrote: > > > > > > > > On Tue, 18 Feb 2025 at 15:26, Zhijie Hou (

Re: Restrict copying of invalidated replication slots

2025-02-22 Thread Peter Smith
Some review comments for patch v2-0001. == Commit message 1. Currently we can copy an invalidated logical and physical replication slot using functions 'pg_copy_logical_replication_slot' and 'pg_copy_physical_replication_slot' respectively. With this patch we will throw an error in such cases

Re: Restrict copying of invalidated replication slots

2025-02-21 Thread Masahiko Sawada
On Fri, Feb 21, 2025 at 4:30 AM Shlok Kyal wrote: > > On Fri, 21 Feb 2025 at 01:14, Masahiko Sawada wrote: > > > > On Wed, Feb 19, 2025 at 3:46 AM Shlok Kyal wrote: > > > > > > On Tue, 18 Feb 2025 at 15:26, Zhijie Hou (Fujitsu) > > > wrote: > > > > > > > > On Monday, February 17, 2025 7:31 PM S

Re: Restrict copying of invalidated replication slots

2025-02-21 Thread Shlok Kyal
On Fri, 21 Feb 2025 at 01:14, Masahiko Sawada wrote: > > On Wed, Feb 19, 2025 at 3:46 AM Shlok Kyal wrote: > > > > On Tue, 18 Feb 2025 at 15:26, Zhijie Hou (Fujitsu) > > wrote: > > > > > > On Monday, February 17, 2025 7:31 PM Shlok Kyal > > > wrote: > > > > > > > > On Thu, 13 Feb 2025 at 15:54

Re: Restrict copying of invalidated replication slots

2025-02-20 Thread Masahiko Sawada
On Wed, Feb 19, 2025 at 3:46 AM Shlok Kyal wrote: > > On Tue, 18 Feb 2025 at 15:26, Zhijie Hou (Fujitsu) > wrote: > > > > On Monday, February 17, 2025 7:31 PM Shlok Kyal > > wrote: > > > > > > On Thu, 13 Feb 2025 at 15:54, vignesh C wrote: > > > > > > > > On Tue, 4 Feb 2025 at 15:27, Shlok Kya

Re: Restrict copying of invalidated replication slots

2025-02-19 Thread Shlok Kyal
On Tue, 18 Feb 2025 at 15:26, Zhijie Hou (Fujitsu) wrote: > > On Monday, February 17, 2025 7:31 PM Shlok Kyal > wrote: > > > > On Thu, 13 Feb 2025 at 15:54, vignesh C wrote: > > > > > > On Tue, 4 Feb 2025 at 15:27, Shlok Kyal wrote: > > > > > > > > Hi, > > > > > > > > Currently, we can copy an

RE: Restrict copying of invalidated replication slots

2025-02-18 Thread Zhijie Hou (Fujitsu)
On Monday, February 17, 2025 7:31 PM Shlok Kyal wrote: > > On Thu, 13 Feb 2025 at 15:54, vignesh C wrote: > > > > On Tue, 4 Feb 2025 at 15:27, Shlok Kyal wrote: > > > > > > Hi, > > > > > > Currently, we can copy an invalidated slot using the function > > > 'pg_copy_logical_replication_slot'. A

Re: Restrict copying of invalidated replication slots

2025-02-17 Thread Shlok Kyal
On Thu, 13 Feb 2025 at 15:54, vignesh C wrote: > > On Tue, 4 Feb 2025 at 15:27, Shlok Kyal wrote: > > > > Hi, > > > > Currently, we can copy an invalidated slot using the function > > 'pg_copy_logical_replication_slot'. As per the suggestion in the > > thread [1], we should prohibit copying of su

Re: Restrict copying of invalidated replication slots

2025-02-17 Thread Shlok Kyal
On Mon, 17 Feb 2025 at 10:37, Peter Smith wrote: > > Hi. Some review comments for patch v1-0001. > > == > 1. DOCS? > > Shouldn't the documentation [1] for pg_copy_logical_replication_slot() > and pg_copy_physical_replication_slot() be updated to mention this? > > == > src/backend/replicati

Re: Restrict copying of invalidated replication slots

2025-02-16 Thread Peter Smith
Hi. Some review comments for patch v1-0001. == 1. DOCS? Shouldn't the documentation [1] for pg_copy_logical_replication_slot() and pg_copy_physical_replication_slot() be updated to mention this? == src/backend/replication/slotfuncs.c 2. + /* We should not copy invalidated replication sl

Re: Restrict copying of invalidated replication slots

2025-02-13 Thread vignesh C
On Tue, 4 Feb 2025 at 15:27, Shlok Kyal wrote: > > Hi, > > Currently, we can copy an invalidated slot using the function > 'pg_copy_logical_replication_slot'. As per the suggestion in the > thread [1], we should prohibit copying of such slots. > > I have created a patch to address the issue. This