Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tp1Dz-00H7fA-Qv for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Mar 2025 08:32:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1toweD-00DP74-5P for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Mar 2025 03:39:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1toweC-00DP5a-Ps for pgsql-hackers@lists.postgresql.org; Mon, 03 Mar 2025 03:39:16 +0000 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1towe9-000d6M-0H for pgsql-hackers@lists.postgresql.org; Mon, 03 Mar 2025 03:39:16 +0000 Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-2fea47bcb51so7861831a91.2 for ; Sun, 02 Mar 2025 19:39:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740973152; x=1741577952; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=RaAtf8At7MhjuSBCvoHH4fYe+lcwSsMWO3IB4h+LM+Q=; b=D+NFhHIOGDc97nRDLaRS0Vt/9oHvGHoaIgbB5xsOAREcv4jToxJ9zdNxM/dQUv4S2G S5Qb8fWAMie4tKO7pEHK31kzcG/KOC319wDLVoEl6+tY2srj1u/AkHjafFKu4D0UgsEX EhxfObW+RAPIDZwhUAz0anOquIlzsmxOQAZ/ZWqXa+lMxLPjniQmWj6Ie6YLrLYOLwnO 7B2GZOosU0iM5LPBD4QOn4vX7mWVft3dWn7UEYtcWxe1gnEotXOSpDT7aiAgthHP5YK/ FKm2Gyornh2K9rzGJbY9n8uqD7crZbQk+t+to9AttqOwkm55lRVqDvJmF81jrVV5F7Bp u8nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740973152; x=1741577952; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RaAtf8At7MhjuSBCvoHH4fYe+lcwSsMWO3IB4h+LM+Q=; b=hJ5+823KKIfnVVhCeZaAKyd4j7D2+wiIWssYsNfXrK2pwblSET8fo8ySubPRCoM2ef qLDtuuBuBEpuBSlYavzPlVa6T9JWpGWZG+Jw0z3RMBnKS6VJ+KiBb9a+v1WbKPlFANwB fpaJh46J8ufdmQmEQP6YrOMbjqjpXNRw+MSBTkohC8HTAt3ceIQVyssqJZ4YieyP9IMp ottcoOK5036Y1V2NLO/61VsxxqyktaBQffBwLrBVJYG/blF+xu7aSp/r0ePIPXH1DeMV 9QibS/aeYHMywG72cucPtz340mQSLeU87IXCvjHZyRBBdCOhkywHGMQJEV/pSQv4Yp01 T5jQ== X-Forwarded-Encrypted: i=1; AJvYcCUeOJuTJfV4XGfKbxjHkqAL7bmpBnnrjROhDiRVQRnczsju3rUfn3m+3FtSE/0DjZA+rfTAQ9AleKm6bOyj@lists.postgresql.org X-Gm-Message-State: AOJu0YxyKGuFesfXrSdpaV+GN05X9OhOA/syKn43RNmKR6kod5J6H/4s VegRBtjQEb3EVfyBP0/aeJits5Gee1ofDm9099rTK4Av8CEEE+d6F9pYmVNFMdpuJE8IkCSjQzW ZI35K8LHjeUHs0IZo/JyuP7GF2OI= X-Gm-Gg: ASbGnctS1X3hq2JGMhZaHTuMsUZjE3i0yoL0AwSr8BI/LbVOOkVjPxp0+WMfVFZoct1 S5GVWyeuITAQma6LUeKqnDM9bgctYUGAquXpjyB8z2TShIgctxs4MnGO/flPbvAHG7ajoGcyht3 4DfRh4awL0cZm5NB28PhO05Zi4BHMH X-Google-Smtp-Source: AGHT+IGJYqQb1sCP5j1PhZI/R2b+L7bSKzGAW+6Wwcy+U1zsr1wDzjInvb89CEugrh9g3QsDaV88obyjPnSDOl0Wajc= X-Received: by 2002:a17:90b:4990:b0:2fa:2252:f438 with SMTP id 98e67ed59e1d1-2febabf892cmr18395222a91.30.1740973151623; Sun, 02 Mar 2025 19:39:11 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Amit Kapila Date: Mon, 3 Mar 2025 09:08:59 +0530 X-Gm-Features: AQ5f1JpgfbJO6fQrhOeHB3FWyCBt0IixD0TYBswx7I41VgqK6_B06dBdmuT6Uww Message-ID: Subject: Re: [Patch] add new parameter to pg_replication_origin_session_setup To: Euler Taveira Cc: Doruk Yilmaz , pgsql-hackers@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Jan 9, 2025 at 3:26=E2=80=AFAM Euler Taveira wr= ote: > > On Thu, Aug 15, 2024, at 5:53 PM, Doruk Yilmaz wrote: > > Hello again, > > On Tue, Aug 13, 2024 at 12:48=E2=80=AFAM Euler Taveira wrote: > > I'm curious about your use case. Is it just because the internal functi= on has a > > different signature or your tool is capable of apply logical replicatio= n changes > > in parallel using the SQL API? > > The latter is correct, it applies logical replication changes in parallel= . > Since multiple connections may commit, we need all of them to be able > to advance the replication origin. > To use replication_origin by multiple processes, one must maintain the commit order as we do internally by allowing the leader process to wait for the parallel worker to finish the commit. See comments atop replorigin_session_setup(). Now, we could expose the pid parameter as proposed by the patch after documenting the additional requirements, but I am afraid that users may directly start using the API without following the commit order principle, which can lead to incorrect replication. So, isn't it better to do something to avoid the misuse of this feature before exposing it? --=20 With Regards, Amit Kapila.