Re: Separate GUC for replication origins

2025-04-05 Thread Amit Kapila
On Wed, Mar 19, 2025 at 10:43 AM Masahiko Sawada wrote: > > On Mon, Mar 17, 2025 at 6:05 PM Euler Taveira wrote: > > > > On Mon, Mar 17, 2025, at 8:44 PM, Masahiko Sawada wrote: > > > > I would suggest putting the new max_active_replication_origins after > > max_parallel_apply_workers_per_subscri

Re: Separate GUC for replication origins

2025-04-05 Thread Masahiko Sawada
On Thu, Mar 20, 2025 at 8:38 PM Amit Kapila wrote: > > On Thu, Mar 20, 2025 at 10:37 PM Masahiko Sawada > wrote: > > > > On Wed, Mar 19, 2025 at 8:15 PM Amit Kapila wrote: > > > > > > On Wed, Mar 19, 2025 at 10:43 AM Masahiko Sawada > > > wrote: > > > > > > > > On Mon, Mar 17, 2025 at 6:05 PM

Re: Separate GUC for replication origins

2025-03-20 Thread Amit Kapila
On Thu, Mar 20, 2025 at 10:37 PM Masahiko Sawada wrote: > > On Wed, Mar 19, 2025 at 8:15 PM Amit Kapila wrote: > > > > On Wed, Mar 19, 2025 at 10:43 AM Masahiko Sawada > > wrote: > > > > > > On Mon, Mar 17, 2025 at 6:05 PM Euler Taveira wrote: > > > > > > > > On Mon, Mar 17, 2025, at 8:44 PM,

Re: Separate GUC for replication origins

2025-03-20 Thread Masahiko Sawada
On Wed, Mar 19, 2025 at 8:15 PM Amit Kapila wrote: > > On Wed, Mar 19, 2025 at 10:43 AM Masahiko Sawada > wrote: > > > > On Mon, Mar 17, 2025 at 6:05 PM Euler Taveira wrote: > > > > > > On Mon, Mar 17, 2025, at 8:44 PM, Masahiko Sawada wrote: > > > > > > I would suggest putting the new max_acti

Re: Separate GUC for replication origins

2025-03-18 Thread Masahiko Sawada
On Mon, Mar 17, 2025 at 6:05 PM Euler Taveira wrote: > > On Mon, Mar 17, 2025, at 8:44 PM, Masahiko Sawada wrote: > > I would suggest putting the new max_active_replication_origins after > max_parallel_apply_workers_per_subscription as both > max_sync_workers_per_subscription and > max_parallel_ap

Re: Separate GUC for replication origins

2025-03-17 Thread Euler Taveira
On Mon, Mar 17, 2025, at 8:44 PM, Masahiko Sawada wrote: > I would suggest putting the new max_active_replication_origins after > max_parallel_apply_workers_per_subscription as both > max_sync_workers_per_subscription and > max_parallel_apply_workers_per_subscription are related to > max_logical_re

Re: Separate GUC for replication origins

2025-03-17 Thread Masahiko Sawada
On Thu, Mar 13, 2025 at 5:55 PM Euler Taveira wrote: > > On Thu, Mar 13, 2025, at 11:10 AM, vignesh C wrote: > > Few comments: > > > Thanks for taking a look. > > 1) After selecting max_active_replication_origins setting in the > SELECT query having order by, the first record returned will be the

Re: Separate GUC for replication origins

2025-03-17 Thread Euler Taveira
On Fri, Mar 14, 2025, at 5:48 AM, vignesh C wrote: > 1) Should we add a test case to verify that if > max_active_replication_origins is set to -1, it will use > max_replication_slots value: I don't think so. I added the following assert to test exactly this condition. if (max_active_repli

Re: Separate GUC for replication origins

2025-03-14 Thread vignesh C
On Fri, 14 Mar 2025 at 06:25, Euler Taveira wrote: > > On Thu, Mar 13, 2025, at 11:10 AM, vignesh C wrote: > > Few comments: > > > Thanks for taking a look. > > 1) After selecting max_active_replication_origins setting in the > SELECT query having order by, the first record returned will be the >

Re: Separate GUC for replication origins

2025-03-13 Thread Euler Taveira
On Thu, Mar 13, 2025, at 11:10 AM, vignesh C wrote: > Few comments: Thanks for taking a look. > 1) After selecting max_active_replication_origins setting in the > SELECT query having order by, the first record returned will be the > one with max_active_replication_origins, rather than the second

Re: Separate GUC for replication origins

2025-03-13 Thread vignesh C
On Thu, 13 Mar 2025 at 05:59, Euler Taveira wrote: > > On Wed, Mar 12, 2025, at 8:47 AM, vignesh C wrote: > > I reviewed the discussion on this thread and believe we now have an > agreement on the design and GUC names. However, the patch still needs > updates and extensive testing, especially cons

Re: Separate GUC for replication origins

2025-03-12 Thread vignesh C
On Thu, 13 Mar 2025 at 05:59, Euler Taveira wrote: > > On Wed, Mar 12, 2025, at 8:47 AM, vignesh C wrote: > > I reviewed the discussion on this thread and believe we now have an > agreement on the design and GUC names. However, the patch still needs > updates and extensive testing, especially cons

Re: Separate GUC for replication origins

2025-03-12 Thread Euler Taveira
On Wed, Mar 12, 2025, at 8:47 AM, vignesh C wrote: > I reviewed the discussion on this thread and believe we now have an > agreement on the design and GUC names. However, the patch still needs > updates and extensive testing, especially considering its impact on > backward compatibility. I'm unsure

Re: Separate GUC for replication origins

2025-03-12 Thread vignesh C
On Fri, 7 Mar 2025 at 21:21, Euler Taveira wrote: > > On Fri, Mar 7, 2025, at 11:47 AM, Peter Eisentraut wrote: > > Is that maximum active for the whole system, or maximum active per > session, or maximum active per created origin, or some combination of these? > > > It is a cluster-wide setting.

Re: Separate GUC for replication origins

2025-03-07 Thread Euler Taveira
On Fri, Mar 7, 2025, at 11:47 AM, Peter Eisentraut wrote: > Is that maximum active for the whole system, or maximum active per > session, or maximum active per created origin, or some combination of these? > It is a cluster-wide setting. Similar to max_replication_slots. I will make sure the GUC

Re: Separate GUC for replication origins

2025-03-07 Thread Peter Eisentraut
On 07.03.25 04:51, Amit Kapila wrote: I agree that the originally proposed name max_replication_origins is not good, because you can "create" (using pg_replication_origin_create()) more than the configured maximum. What is the term for what the setting actually controls? How many are "active"?

Re: Separate GUC for replication origins

2025-03-07 Thread Amit Kapila
On Thu, Mar 6, 2025 at 6:36 PM Euler Taveira wrote: > > On Thu, Mar 6, 2025, at 6:55 AM, Amit Kapila wrote: > > On Wed, Mar 5, 2025 at 4:38 PM Peter Eisentraut wrote: > > > > On 11.02.25 21:25, Euler Taveira wrote: > > > Here is another patch that only changes the GUC name to > > > max_replicatio

Re: Separate GUC for replication origins

2025-03-06 Thread Amit Kapila
On Wed, Mar 5, 2025 at 4:38 PM Peter Eisentraut wrote: > > On 11.02.25 21:25, Euler Taveira wrote: > > Here is another patch that only changes the GUC name to > > max_replication_origin_sessions. > > I think the naming and description of this is still confusing. > ... ... > > I agree that the orig

Re: Separate GUC for replication origins

2025-03-06 Thread Euler Taveira
On Thu, Mar 6, 2025, at 6:55 AM, Amit Kapila wrote: > On Wed, Mar 5, 2025 at 4:38 PM Peter Eisentraut wrote: > > > > On 11.02.25 21:25, Euler Taveira wrote: > > > Here is another patch that only changes the GUC name to > > > max_replication_origin_sessions. > > > > I think the naming and descripti

Re: Separate GUC for replication origins

2025-03-05 Thread Peter Eisentraut
On 11.02.25 21:25, Euler Taveira wrote: Here is another patch that only changes the GUC name to max_replication_origin_sessions. I think the naming and description of this is still confusing. What does this name mean? There is (I think) no such thing as a "replication origin session". So wh

Re: Separate GUC for replication origins

2025-03-05 Thread Amit Kapila
On Wed, Mar 5, 2025 at 12:42 PM Masahiko Sawada wrote: > > On Tue, Mar 4, 2025 at 10:42 PM Amit Kapila wrote: > > > > On Wed, Mar 5, 2025 at 6:24 AM Euler Taveira wrote: > > > > > > On Sat, Mar 1, 2025, at 10:08 AM, Amit Kapila wrote: > > > > > > On Thu, Feb 13, 2025 at 6:48 AM Masahiko Sawada

Re: Separate GUC for replication origins

2025-03-04 Thread Masahiko Sawada
On Tue, Mar 4, 2025 at 10:42 PM Amit Kapila wrote: > > On Wed, Mar 5, 2025 at 6:24 AM Euler Taveira wrote: > > > > On Sat, Mar 1, 2025, at 10:08 AM, Amit Kapila wrote: > > > > On Thu, Feb 13, 2025 at 6:48 AM Masahiko Sawada > > wrote: > > > > > > Thank you for updating the patch! The patch look

Re: Separate GUC for replication origins

2025-03-04 Thread Amit Kapila
On Wed, Mar 5, 2025 at 6:24 AM Euler Taveira wrote: > > On Sat, Mar 1, 2025, at 10:08 AM, Amit Kapila wrote: > > On Thu, Feb 13, 2025 at 6:48 AM Masahiko Sawada wrote: > > > > Thank you for updating the patch! The patch looks mostly good to me. > > > > + /* > + * Prior to PostgreSQL 18, max_repli

Re: Separate GUC for replication origins

2025-03-04 Thread Euler Taveira
On Sat, Mar 1, 2025, at 10:08 AM, Amit Kapila wrote: > On Thu, Feb 13, 2025 at 6:48 AM Masahiko Sawada wrote: > > > > Thank you for updating the patch! The patch looks mostly good to me. > > > > + /* > + * Prior to PostgreSQL 18, max_replication_slots was used to set the > + * number of replicati

Re: Separate GUC for replication origins

2025-03-01 Thread Amit Kapila
On Thu, Feb 13, 2025 at 6:48 AM Masahiko Sawada wrote: > > Thank you for updating the patch! The patch looks mostly good to me. > + /* + * Prior to PostgreSQL 18, max_replication_slots was used to set the + * number of replication origins. For backward compatibility, -1 indicates + * to use the f

Re: Separate GUC for replication origins

2025-02-12 Thread Masahiko Sawada
On Tue, Feb 11, 2025 at 12:27 PM Euler Taveira wrote: > > On Wed, Feb 5, 2025, at 9:49 PM, Masahiko Sawada wrote: > > On Wed, Feb 5, 2025 at 4:39 PM Euler Taveira wrote: > > > > On Wed, Feb 5, 2025, at 1:56 AM, Amit Kapila wrote: > > > > On Wed, Feb 5, 2025 at 8:17 AM Euler Taveira wrote: > > >

Re: Separate GUC for replication origins

2025-02-11 Thread Euler Taveira
On Wed, Feb 5, 2025, at 9:49 PM, Masahiko Sawada wrote: > On Wed, Feb 5, 2025 at 4:39 PM Euler Taveira wrote: > > > > On Wed, Feb 5, 2025, at 1:56 AM, Amit Kapila wrote: > > > > On Wed, Feb 5, 2025 at 8:17 AM Euler Taveira wrote: > > > > > > Under reflection, an accurate name is > > > max_replic

Re: Separate GUC for replication origins

2025-02-05 Thread Masahiko Sawada
On Wed, Feb 5, 2025 at 4:39 PM Euler Taveira wrote: > > On Wed, Feb 5, 2025, at 1:56 AM, Amit Kapila wrote: > > On Wed, Feb 5, 2025 at 8:17 AM Euler Taveira wrote: > > > > Under reflection, an accurate name is max_replication_origin_session_setup. > > A > > counter argument is that it is a long

Re: Separate GUC for replication origins

2025-02-05 Thread Euler Taveira
On Wed, Feb 5, 2025, at 1:56 AM, Amit Kapila wrote: > On Wed, Feb 5, 2025 at 8:17 AM Euler Taveira wrote: > > > > Under reflection, an accurate name is max_replication_origin_session_setup. > > A > > counter argument is that it is a long name (top-5 length). > > > > postgres=# select n, length(n)

Re: Separate GUC for replication origins

2025-02-04 Thread Amit Kapila
On Wed, Feb 5, 2025 at 8:17 AM Euler Taveira wrote: > > Under reflection, an accurate name is max_replication_origin_session_setup. A > counter argument is that it is a long name (top-5 length). > > postgres=# select n, length(n) from (values('max_replication_origins'), > ('max_tracked_replication

Re: Separate GUC for replication origins

2025-02-04 Thread Euler Taveira
On Fri, Jan 24, 2025, at 8:12 PM, Masahiko Sawada wrote: > Here are some comments on v2 patch: > > --- > /* Report this after the initial starting message for consistency. */ > - if (max_replication_slots == 0) > + if (max_replication_origins == 0) > ereport(ERR

Re: Separate GUC for replication origins

2025-01-24 Thread Masahiko Sawada
On Wed, Jan 8, 2025 at 7:39 AM Euler Taveira wrote: > > On Thu, Dec 19, 2024, at 10:31 AM, Peter Eisentraut wrote: > > On 10.12.24 19:41, Euler Taveira wrote: > > I'm attaching a patch that adds max_replication_origins. It basically > > replaces > > all of the points that refers to max_replication

Re: Separate GUC for replication origins

2025-01-22 Thread Keisuke Kuroda
Hi Euler, As you may have already read, separating the max_replication_slots parameter is also discussed in the following thread. https://www.postgresql.org/message-id/flat/CAA4eK1KF4MbyWmPj9ctNo8Fiei%3DK91RGYtzV5ELeCvR%3D_rqNgg%40mail.gmail.com#3012c5c18e40e 21ac553b42d53249e42 I agree with sep

Re: Separate GUC for replication origins

2025-01-08 Thread Euler Taveira
On Thu, Dec 19, 2024, at 10:31 AM, Peter Eisentraut wrote: > On 10.12.24 19:41, Euler Taveira wrote: > > I'm attaching a patch that adds max_replication_origins. It basically > > replaces > > all of the points that refers to max_replication_slots on the subscriber. It > > uses the same default val

Re: Separate GUC for replication origins

2024-12-19 Thread Peter Eisentraut
On 10.12.24 19:41, Euler Taveira wrote: I'm attaching a patch that adds max_replication_origins. It basically replaces all of the points that refers to max_replication_slots on the subscriber. It uses the same default value as max_replication_slots (10). I did nothing to keep the backward compat