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 1ugcev-005Xbo-Sl for pgsql-hackers@arkaria.postgresql.org; Tue, 29 Jul 2025 05:13:54 +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 1ugceu-00EiOz-SM for pgsql-hackers@arkaria.postgresql.org; Tue, 29 Jul 2025 05:13:53 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ugceu-00EiOr-IV for pgsql-hackers@lists.postgresql.org; Tue, 29 Jul 2025 05:13:52 +0000 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1ugces-001KA6-37 for pgsql-hackers@lists.postgresql.org; Tue, 29 Jul 2025 05:13:51 +0000 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-ae3b336e936so1044781566b.3 for ; Mon, 28 Jul 2025 22:13:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753766027; x=1754370827; 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=c0tbkb8vMpv7L5CyXq7ruf6t3n1uvWYAWDwmvhxj+2c=; b=AMVGuhoCUmY0gHVeT8yF0yc+UBO1urEytomFM8WRRvtQJetBgMl0fjclupMFac/ryA YOrIo+nAMBn/wLJzVyFempEBaF9rSqHvqAdH2KI3f92BFYd7csLbqWCSYVmPWQja8AaG ZGxRZlRH0FUe5ylnQ8HZG7yobQPoXw73+AVoSXh1L+S4c/xHa8tUvldQKqLD5nv42P1r ry6uhqbbeGtXE2kHzeqbSUurEsmBOkTJ25hsDYzYAQyjv6NLdKlcfUk8HYCibuam3Dlw hEKpR+KN8fU3AO4XlwKNyYyNVIN7Zlfi2KzT2QWwzunwCBPuunBa3wb5nh67wKT6lfO0 SBxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753766027; x=1754370827; 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=c0tbkb8vMpv7L5CyXq7ruf6t3n1uvWYAWDwmvhxj+2c=; b=hHdTRMeI/D81qdjyBcLFJsPpJ4FFBbN7mlJ1WM7ruBHqbK6pZW8DIkotAKNgaU0oum jrcBEdjhcfROQJTegFU1jhVUQwzrhQULblz9gm4gt7EwqwCQcEY2McWkHQabcXcu8IJB 5bxKTBIDzUHRu2aTtLKDbkQU/ZP6X9PG6Qg6cP1FtN8lUdWdIOwHaQsr/Ca5qfKVmahw 2ZWtPnVLCOAY6bRhchJjhHAvOY5cKvwqjkXUFxaEuiwGXJov76+YMiGV1Ty9l0aykF59 RAF1KT2K/u52oxWYRt+7GpV65VMwbau5XnvzBEw7djlcTvdV1ceTBmnHDUgnR7FI2Qc+ gO6g== X-Forwarded-Encrypted: i=1; AJvYcCX92/lddvp66HIYZAKIThS2jK8YmalPIWVqV4GBbt0TesEalKVGcgOajP4OdFvIFjs0lXGWiyjae3CYn6Oz@lists.postgresql.org X-Gm-Message-State: AOJu0YzFLXoXSPV8temzTZuIdwrszdZUQjSeypc+/beKFXkk41J484J0 l1V/YWvCUJE5S0yw58kLRa8mhR1hrP72epeaUzAAfcmi5KiNZPga+Ca5T2KsqO8g8YJrSHQTaWj q3cwHac8VUkwvyjsw+kQ75h6XCFn/2vE= X-Gm-Gg: ASbGncve01egIVSGfGByOdOzvB5Xg8UBTmzXydecU664Yij7Jci7vuWkdGg5PNlc3am JAzjbPiwtchFQgvdXRldThOhURXVFLemzkrJdYPKTxWkwvf0hdhqxr4oi8u1sAytXV5EIABHVHm 5g4qSIZT3VGA6rvTg8DnTqvox3oEmjlkPF+tp+fqOF1NKFGuokrCjmE/0QGseiohk321snsCi1k hykE9oe6x8miDEK4dKU X-Google-Smtp-Source: AGHT+IGG7j6du+t+ly/SVkRevcCPKq+lPVf7EtmNKB7WIMTk/sS3AScR4XoK38viE+8PP7Rrk3bJu0OT1vqZ9E/dvNw= X-Received: by 2002:a17:906:fe0c:b0:ae3:74e1:81a3 with SMTP id a640c23a62f3a-af61c2b41e1mr1409322166b.8.1753766026955; Mon, 28 Jul 2025 22:13:46 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Amit Kapila Date: Tue, 29 Jul 2025 10:43:32 +0530 X-Gm-Features: Ac12FXxILmFK6Bk7PtWhOlycqXVmqv6Sjp3Kv3MWmnn7w4cQtSNyKggjVxBUFL4 Message-ID: Subject: Re: [Patch] add new parameter to pg_replication_origin_session_setup To: Doruk Yilmaz Cc: Euler Taveira , 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 Tue, Jul 29, 2025 at 2:43=E2=80=AFAM Doruk Yilmaz wr= ote: > > On Mon, Mar 3, 2025 at 6:39=E2=80=AFAM Amit Kapila wrote: > > > > 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? > > Wouldn't mentioning/describing needing to follow the commit order > principle on the documentation be enough for this? > It is quite an advanced feature that I don't believe person intending > to use it won't start with reading documentation first. > That is true but I still feel there has to be some mechanism where we can catch and give an ERROR to the user, if it doesn't follow the same. For example, pg_replication_origin_advance() always allows going backwards in terms of LSN which means if one doesn't follow commit order, it can lead to breaking the replication as after restart the client can ask to start replication from some prior point. > > Is there any updates on the commit? > I think we are still under discussion about the requirements and design for this API. Can you tell us the use case? Did you also intend to use it for parallel apply, if so, can you also tell at a high level, how you are planning to manage origin? It will help us to extend the API(s) in a meaningful way. --=20 With Regards, Amit Kapila.