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 1ve4OJ-008VJt-1g for pgsql-bugs@arkaria.postgresql.org; Fri, 09 Jan 2026 04:46:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1ve4OI-005iyz-0J for pgsql-bugs@arkaria.postgresql.org; Fri, 09 Jan 2026 04:46:26 +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.96) (envelope-from ) id 1ve4OH-005iyr-2g for pgsql-bugs@lists.postgresql.org; Fri, 09 Jan 2026 04:46:26 +0000 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1ve4OF-005PW9-31 for pgsql-bugs@lists.postgresql.org; Fri, 09 Jan 2026 04:46:25 +0000 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-598f81d090cso3954488e87.2 for ; Thu, 08 Jan 2026 20:46:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767933981; x=1768538781; 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=BbLkS31wI9ep1XYC7K1t464lfvt3HJDuxgIeiaEqKMI=; b=J+GhPVQOlGSNlKcc5Fgi/ORdxu8vTU3Hsb1QvJoh2BB5gxUWRXf16xFh97B1g6WSfB 4IG8vICWnrzULzOv6KC0IR+/9G1W66J9qjVRiBnWHGHIHvlSff6dck5ZrGtSDL4Q5PXF t6+nLV8JFsRtNzXIEB8JMtw/pCoiyfObBetclYvkmifJnW5Nn7S++LXRy7OcHKV5Ojpx O+M/Z+Ufk2z5zS+5aDIH3yGGtprFK393SfvWa8FxbKHhRc1rBUucrL8YY3K3haEGnbGD pEDPA7z/o+28hSlK5JW3nM0p7beyR4Ye0i3BfoaAO5OtZYqjak9Cya74bmoz866Xt1Rf KEnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767933981; x=1768538781; 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=BbLkS31wI9ep1XYC7K1t464lfvt3HJDuxgIeiaEqKMI=; b=CO/fabrLjPChzQvgILU446FAXAd828YbcU14/u4wahoZDXepT3TU3qojbIi13m+RUa IuIDiGl0PSTqvNth2hMqkgQvQPIs4WoDH1d0xGflGJ69snnEqj0NcFjLVj6RygnnbmPb 5abpl9YONWpALv9nsTpjv0U3KBbj/jnzI+EwaiDqlJQhpP0CTpQ6mGf58Ls7berE5cFV 5+uJY9Pn9reAvQSHN5dwq/1k71U/+XQQy50A3WpjQPsxnFWlQQPCl3bIgf4U3HiKGr7a KQEbbLB9xmLCZ3YpBPDSexjEs3bj9YPqqMVTpRxzRO0kC2hTFtGrn121d9WWr9dJqgiW Q2Tg== X-Forwarded-Encrypted: i=1; AJvYcCWuanRO/qxcPb9+hJddcpS9VgXT1pckJKIBZqZ+B+XiXINlWhFxBWYF/zHV+RhULn0hCrR2E3QgxqO/@lists.postgresql.org X-Gm-Message-State: AOJu0Yzbry5TervrdmUwgRBIUMmAxcbwDSbbwTSNaujHEUy+BBagmUtz 3brObfUm234bmEzNlU4j76l/xh8vi+EeNBQF/V+S3HnmovZoo960HOlsIbl2Prbzt+rxw5uRwad KyAxna7QmGEiyPSJ5EUdBWZC7XEE6+UU= X-Gm-Gg: AY/fxX5iOGUPZODGPE7eScG5aE7cosJWxofIOl9leE6m0+I75JK3gDQ0zvuS9ziXP8X J32CwyTiNhEAlvuU3wcRk1+duHUcwAD87FZmVms91lNr3OcBdDl0QSDbI4wYBB+BvNx0EIl70fB hmwkHeZtcTNZ7obogfy1VFpsSk0eHrpRISUZldYu0SVqmnZyxbYItaRmbHplHNUxN4k/v1055T0 sMaFHYgDk9RHY4lp89jFWdEO7dZhBS02gFgFs6/lYignhyVe3K3jljSmivyPpnsV8cFebBYY1bl /WiOlq+pnXPZHh+Blg9yzUdIEg== X-Google-Smtp-Source: AGHT+IHW74rR2VypSdY2r6o80ZP9pjfsVamMfSpfMdS3K+Y6Kwd7w9qubJJ+T1f3E0bnO1v6AWSI5jiQKXkV6ZzWVvA= X-Received: by 2002:a05:6512:33cf:b0:594:493b:abd with SMTP id 2adb3069b0e04-59b6f01fd53mr2957083e87.13.1767933981041; Thu, 08 Jan 2026 20:46:21 -0800 (PST) MIME-Version: 1.0 References: <19360-1952ab7afd799f70@postgresql.org> In-Reply-To: From: Dilip Kumar Date: Fri, 9 Jan 2026 10:16:04 +0530 X-Gm-Features: AQt7F2pt5uPXwCMpXTHveNhTtOGesr1WgMJFQSkVjc4YguxSkssYsI17wSJmfqQ Message-ID: Subject: Re: BUG #19360: Bug Report: Logical Replication initial sync fails with "conflict=update_origin_differs" PG12 toPG18 To: Masahiko Sawada Cc: Amit Kapila , vignesh C , mostafaa.hasanzadeh@gmail.com, pgsql-bugs@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 Fri, Jan 9, 2026 at 4:17=E2=80=AFAM Masahiko Sawada wrote: > > On Mon, Dec 29, 2025 at 10:55=E2=80=AFPM Amit Kapila wrote: > > > > On Mon, Dec 29, 2025 at 4:26=E2=80=AFPM vignesh C = wrote: > > > > > > On Mon, 22 Dec 2025 at 19:00, PG Bug reporting form > > > wrote: > > > > > > > > > > This can occur in the following scenario: commit timestamp tracking i= s > > > enabled on the subscriber; the same table exists on both publisher an= d > > > subscriber; a publication is created on the publisher with initial > > > data; and a subscription is created on the subscriber with origin =3D > > > none. During the initial table synchronization, the row is inserted > > > using a tablesync replication origin, which is dropped once > > > synchronization completes. If the row is updated on the publisher > > > after the initial sync, the apply worker attempts to update a row tha= t > > > was inserted using a different replication origin(tablesync origin), > > > resulting in an origin mismatch. > > > > > > The conflict is logged and logical replication continues normally. No > > > crash occurs, and the log entry is informational rather than > > > indicative of a failure. > > > > > > > I agree with this analysis. > > > > > These messages can be safely ignored for now. > > > > > > We are currently evaluating possible improvements to handle this > > > scenario more gracefully and to avoid reporting these conflicts in th= e > > > future. > > > > > > > One idea to safely ignore these LOGs is we could modify the state > > management in the catalog pg_subscription_rel to store originID. When > > a tablesync worker completes, instead of just deleting the origin and > > setting the relation state to ready, it could record the origin_id it > > used into pg_subscription_rel. When the apply worker encounters an > > origin mismatch, it checks pg_subscription_rel for that specific > > table. If the "old" origin ID matches the one recorded during the sync > > phase, the worker knows the row is "ours" and suppresses the log. Now, > > as the origin ID could be reused, we could additionally store local > > timestamp along with originId in pg_subscription_rel. Then, we can > > suppress the log if: row_origin_id =3D=3D srsuboriginid AND > > row_commit_time <=3D srsubsynctime. > > It sounds very costly. IIUC we would need these checks for every first > update to tuples loaded via initial table sync. Can we somehow share > the apply worker's origin with tablesync workers so that they can > refer to the same origin ID? Or can we invent special origin IDs > (e.g., > 0x00FF) that are the same as the normal origin ID except for > being ignored by the conflict detection system? How will this distinguish between the initial sync is done from the publisher node we are getting the update vs the initial sync is done from some other node? Can we always ignore conflict checking for initial synced data or do we just want to ignore if the initial sync is done from the same node? --=20 Regards, Dilip Kumar Google