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.96) (envelope-from ) id 1wPAzp-000VL8-1C for pgsql-hackers@arkaria.postgresql.org; Tue, 19 May 2026 03:19:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wPAzm-003gcG-2N for pgsql-hackers@arkaria.postgresql.org; Tue, 19 May 2026 03:19:51 +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.96) (envelope-from ) id 1wPAzm-003gc8-14 for pgsql-hackers@lists.postgresql.org; Tue, 19 May 2026 03:19:51 +0000 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wPAzk-00000000GY7-2Xso for pgsql-hackers@lists.postgresql.org; Tue, 19 May 2026 03:19:50 +0000 Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-36974221f93so1394059a91.2 for ; Mon, 18 May 2026 20:19:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1779160788; cv=none; d=google.com; s=arc-20240605; b=MPkAIh2ZwpqNnvi8E/KS5t47BJ3xZO0GoyVeDwqumdPJXD2V/33eIxt11OD6V5SvgZ lW2x2VLDXjfdN5jwMIrLENKwd4Xx+SKFiYzsfFklxlafkmf53KhqjKajdsYB9GB/F/BT H6qDy+1XJtDRzSErJGl3Fnf4RW/VOaFiutbFmgaFckxs+LW+sK5AnSfwL619YjpAYutE lGdUeolDAqAtP5JXAWD3s5wbNn//HPu+aDHWB1XYxWsTlcfylHVysx7M60vpkelqPW0l 3JPnLzwWh8ciuOQUZUYSzhH6oM1fzYdUCAiZYYUBgvv8Ih8d5yCchgEW5n4B8slBesOc u/sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Uq+XUGspTm5nCAEK4P5ebo4XfeM7TtMoF/EtWpI6KzI=; fh=mYdvbX08B0m4k6jqdEKrAvsp+tiub7CZzhFp+rPrGQs=; b=JqXzoEPe5cJqjwLmp8wm8az5H3Jff65L0UryGCNsHcrOtfmadV7kUK5HQTKvj8rgtv rWTsxkKIsfxFOM4F9Vzt2G2GvQmym1XPTDea8FsnhRBBRYpfmtlSzSeIPjeroEjhZQgZ /4W7XnzjzYPZlkdtQFaU7+YwSnD+YnaotHMwHvoDJhmLJAf3xTcsx0Vyjg69r5UA2w3Y 9bmfJU1QJFVBKkwHRqIqwyCdZzLaXkK7SZbVTp+46QwSaAFSCW3eSVTUDgZTrtnrDjpz A310zQQqfWXwOMi+0px8EyyRkNFLJaUoW4ZywdxUCttlIfAcfFgLx1zNXG3DCduo5x7h NSOg==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779160788; x=1779765588; 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=Uq+XUGspTm5nCAEK4P5ebo4XfeM7TtMoF/EtWpI6KzI=; b=XXxVG4oPvCAPu5TUlyw0fylYE/KZ6yIhOxhCQAmdtLDtPJGJ5mvSGx/nszsaQ2I/RS td0vQ0RRxM8e3U1HEgTM6rFHPnWlVL8TBeCsPxR5LOytoWCPHpFQ2X4Q4Wptpc5P6pKU RcRKxclz8FFLr0bVLgCU20u0uQRNUBOuxYRyQ4m8K91IIdYaFxmcQyZKOgKcprX0SS6/ xIafnam0Tr6fCs7saUEPwUDKiLtWVXyvtXSJYV1ID7QNB/inIlkGDslvQ7UQXU8O0oRr fiHPUjdBGLoH9urtRurpJFADKuOUY0WHmqljkrYGzFl9ipmkhVlSUfsaY7TeYgxVvLFi HGdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779160788; x=1779765588; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Uq+XUGspTm5nCAEK4P5ebo4XfeM7TtMoF/EtWpI6KzI=; b=qcEKhrUq5MGfj1AYyipMvR94vSbEWJTCScaXNxsEXTUVFIj7DS5lgTHQbgVBejfCAh aU2tr6Bh6FxVe2j0tDTbtkYB+E+C3hKOB9j6Gc3JVOcTaRA11p8pInNyAidyc+JcmtoX WqHXOXCBw18yCMQ91HBxPLWe9uph5SoitPUDx32cN/TbMUsd7E/5+f2ZDknIGkdbOpDc hg650BT+U/DQCBWcGegJCEBs48+EncQjlTClVR9kenpdl2qpLH8snVk7EZ9RQb+VEPmx dtV8aUZ7TLqgOYCtH7HSe93QRpjYTqmiYYQIkaNxELxvP6IpzvXenOE4LuM8YzbLLJy9 6bpw== X-Gm-Message-State: AOJu0Ywdw6zKk7oFvqci5wScA3AWAmvMhOfTFh9UIcMSbNgIHb3wA6m/ 41YHv6ZakV6UAIJ6itPAOhApr5DKyf5kcyBATOiwHN2afLDROY89/832ghNkRELIfnySZHfZxx2 LS+PtmVPOM7vG3wV6sUysS2Z/pQHPcGQ= X-Gm-Gg: Acq92OFO594+kRWeWW23LNIGgjcozdGaaY4VZi5Lxngc0QC23hE2yZ65dvHjjGlindJ wob+/UJvH7Ow+F4Wy7edaC19qdFGehaxKseK0PtvTEl0MzGiS9MtLeIG7CcYnMbU2PCevX3Obq+ OTTtZIvkGRQqkuHE3efVca5KRRyG7a1nEbmhLRNgFCjQMGAEo5O6ZvIemc5gJnkwO62Jm5JnOZJ +yoVMjdthZMthgPgrn+6kNPZXohbEFLvx/cX0jFXADglXwJPN0NlusbBETSxvv0/f5XjjVpTM9J On1pRTLvHCjxo73X6koGdp+xFLGIygdEtnQkyFautReQ459MceW36w== X-Received: by 2002:a17:90b:5290:b0:366:1bab:c3d6 with SMTP id 98e67ed59e1d1-36951a02b73mr17164112a91.10.1779160788313; Mon, 18 May 2026 20:19:48 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: shveta malik Date: Tue, 19 May 2026 08:49:36 +0530 X-Gm-Features: AVHnY4IfWgIGfHASI21uxelmKGeK_AfqY-avjFdxFmkDH1HpvzUJVej_bp4nlQA Message-ID: Subject: Re: Improve conflict detection when replication origins are reused To: Nisha Moond Cc: PostgreSQL Hackers 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 Fri, May 15, 2026 at 4:45=E2=80=AFPM Nisha Moond wrote: > > On Fri, May 15, 2026 at 3:27=E2=80=AFPM shveta malik wrote: > > > > Nisha, I think we will get the same problem in another scenario too: > > > > create pub1-server1 > > create pub1-server2 > > create sub1-server3; subscribing to pub1-server1 > > > > --On both server1 and server2, insert same set of rows: > > insert into tab1 values (10), (20), (30); > > > > Sub1 (server3) will get the rows from server1. > > Now alter sub1 to connect to server2 (you will have to create slot > > manually on server2) > > SELECT pg_create_logical_replication_slot('sub1', 'pgoutput', false, > > false, false); > > > > > > --Now perform the update on server2: > > update tab1 set i=3D11 where i=3D10; > > > > The subscriber on server3 will receive update form server2 and will > > update the row inserted by server1 origianlly without raising > > update_origin_differ. > > > > Can you please confirm if my understanding of the problem statement is > > correct and if the scenario above will also result in a similar > > situation? IIUC, in such a case, the proposed solutions may not work > > directly and will need to be further evolved. I will think more once > > you confirm my understanding. > > > > I agree that the above scenario will not raise a conflict, and I think > that is expected with the current replication model, which tracks > which subscription stream applied a row, not which publisher server it > originally came from. > > With the existing replication model, we can also see the opposite > scenario of what you mentioned: if two subscriptions replicate the > same table from the same publisher, update_origin_differs conflicts > can still be raised even though both changes come from the same > source. This again shows that origin identity today is effectively > tied to the subscription stream, not the publisher server. Yes, I agree. Thansk for details. > If we want conflict detection based on publisher identity, that would > require a different model altogether, closer to systems like > BDR/pglogical, which track global node identities across the > replication chain. > > So for now, I think the above scenario is outside the scope of the > current subscription-level origin tracking design. > Yes, looks like so. thanks Shveta