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.98.2) (envelope-from ) id 1xYJp5-000000046xK-0mjS for pgsql-hackers@arkaria.postgresql.org; Tue, 01 Dec 2026 09:06:51 +0000 Received: from localhost ([127.0.0.1]:38046 helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xYJp3-00000001LmE-3Bz1 for pgsql-hackers@arkaria.postgresql.org; Tue, 01 Dec 2026 09:06:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]:35508) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xYJp3-00000001Llv-1ysH for pgsql-hackers@lists.postgresql.org; Tue, 01 Dec 2026 09:06:49 +0000 Received: from mail-pi2-x09.google.com ([2607:f8b0:4864:3a::9]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1xYJp1-00000001OSx-1Bk4 for pgsql-hackers@postgresql.org; Tue, 01 Dec 2026 09:06:49 +0000 Received: by mail-pi2-x09.google.com with SMTP id 41be03b00d2f7-cdb8dad8ea5so2553446a12.1 for ; Tue, 01 Dec 2026 01:06:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796116004; x=1796720804; darn=postgresql.org; h=content-transfer-encoding:content-type:in-reply-to:from:references :cc:to:subject:user-agent:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to:content-type; bh=ub+rWaA8rN3qXVllcAced/U39NveOzRSyXrbkaMXL8M=; b=e2wp1G11pmNB0SzeSVy9y3J1NmcSoxZCOH0Z/RbdBsg/+NEXGWLAvmAkHg8P0Y9ds2 Ar3qCYdGE+BxoYFb0QdGXOqfm0h5120bd+6zqo85MoUhr6AaCvgjMH4Yerqb8yhapZgI Y87S71RmGEKJ2b3n15onwd3B1GGayd8C22AGiHliINZ76bVO5EogBbmavmd5x/YCYm2y +WNBamafBkNj4rlZP9RfyAFNO/W9tZOXDpbiJZIjqz8YVgIwuBMsslDtFgOOQ0CvjdlI HzW2Re9mBsZdEKn71mnyNodw4T3M4JHEWkXccRW8tjXI8L4iMb+XeaxlTnWemAAkKfhY 84cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796116004; x=1796720804; h=content-transfer-encoding:content-type:in-reply-to:from:references :cc:to:subject:user-agent:mime-version:date:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=ub+rWaA8rN3qXVllcAced/U39NveOzRSyXrbkaMXL8M=; b=Tw3lSBx3GGBtXG06YyhOckpBeGLHBcdEH/wANCQpLp2NMO8pfQu7Q1XtuIPZDhjUlS 4Bd7V7WBNcFmtI5GDM30c4z4vfbWBOwWvWgtx1geSfl+IlPjRChc/YbDl0a3JVdC4Ao1 G6taylIAhU1PPkyUGu+C9ddu941WKL8x0uFVM8KIkTOHjwe4OcgjQM3jbhgRKESlWX9i zcbQQmW8BJ3p7aSkKNv5TVK7NPwGRRYuJm3SzG238YSuwELr52jDbsLOxiBSzV3Vu2JG lrvdqvjbJNODX2/VH6IMab4qJk7bL+2gV4IuZ8so/kuEkmDxmVDJZyyiJx52epKmkev8 GArg== X-Forwarded-Encrypted: i=1; AL+hErEIfZpJttAmZPknJaJnVas2c3Gnrn1OaMdq4hKqH21Snv5sv7foKlkLZn8AN+jsju+/4NynS150ADgByIlt@postgresql.org X-Gm-Message-State: APuU4Z+fl7FExzOCY1fxV/BLoyNiXfUWaIv6CfeYR+NVrpbV0Ot26/l3 5W91QCMizzYqeVsmm1v9aUHiwFe2QCDmmgNAeNv0tbmk+hx3AtAq2euf X-Gm-Gg: AZFdTZfbA0sLy/f8YntjEf3Y0BkbNdIlqU/IWYJg4IZft2MgdM/j43dnFMLarfHVFdB HWMF3x0bDd5/xfDcf7XulttrHDZwVZXlOwYdh3kl80zuA7fqks49t6zSAZMYIqMByAMf+iH8DRo ZM2WFFz0Do6G354jDLuC8b2J9+Gd/glRfjreHZBXaGx1auenwpNaFxjndNOcxpHtR4E/zCpezwJ THfGmufMfjuVHfhbiOkXAQoWnptwT0wTWRmuApzXfhoP05j+/VUrEvVGao2lHxz2yyrXq/utoBW WVUW0HmdtnglP7T9cGMOUAlAMKrn/0TiBbpIWAPY2qvQ9ekXExdvjQpanlTB95JpkDBPLQxGUtM 8t9j3k2sHWdxOB5FlqwcBeriuMfgV8ZVF+DhLelYs0XMagqb3YX9sI9nF4VeJEFbHnf2LInRpPc py2U3TmGhUR75Cl7q1rhBuH1Wc5QWJf/z+cnadQz0UL13pVKHM6PtDb/G9i5bLVo/JT0K5jGcxS a6q6btyY6qJ1v2pSXnqL3nVhCsZnvJzpQKjZMazRMC2pPtnyolHo3uSbmeEDXu1/yrLJH0+ZXG7 FqPbE/+ShKgpIQBbr4Xnr5q1b3qpyIJhuk98QMCbTcR64wURoKqfiFqkh5XCz2sd6vaLbrHpLdf SNJf2yEnwr2a71VU9Nv+roysCrSxHQcncmmF6rWoUY8dVyojv39waqckMecxQPFYT6lWRtCgJj6 mqLWYmduGBDUCfDoWb5wGapxCptMQ3NCXCpA== X-Received: by 2002:a05:6a00:4616:b0:8b9:5b8:e87d with SMTP id d2e1a72fcca58-8c87b9cf912mr38067885b3a.16.1796116003670; Tue, 01 Dec 2026 01:06:43 -0800 (PST) Received: from ?IPV6:2400:79c0:20d:180:2517:bbae:d197:2b95? ([2403:300:600d:d80:31d4:bbae:d197:2b95]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8c87285c05fsm19563888b3a.17.2026.12.01.01.06.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Dec 2026 01:06:43 -0800 (PST) Message-ID: <1b885669-20a1-4d62-91de-885427e1d029@gmail.com> Date: Tue, 1 Dec 2026 17:06:38 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Add a hook for handling logical decoding messages on subscribers. To: Masahiko Sawada , Ajin Cherian Cc: Bertrand Drouvot , Amit Kapila , Bharath Rupireddy , Chao Li , Fujii Masao , PostgreSQL-development References: <4d9e1d2f-27a2-40ec-92c8-4b5740736cf8@gmail.com> From: Zhijie Hou In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Sat, Nov21, 2026 at 02:35 AM Masahiko Sawada wrote: > Good find. Since we already treat msg.lsn as the position the message > is applied at when reporting the flush position, it makes sense to > advance the origin to it as well, as we do for commits. > > Given that we’ve agreed on the 0001 patch, I’m going to push it early > next week, barring any objections. I’d like to hold off on the 0002 > patch to give it more review time. Thanks for pushing 0001! I reviewed 0002 and have few comments: 1. + if (!MySubscription->messages || am_tablesync_worker()) + ereport(ERROR, + (errcode(ERRCODE_PROTOCOL_VIOLATION), + errmsg_internal("MESSAGE message received but messages are not enabled for this worker"))); I hit the above internal error in a parallel apply worker when disabling the "messages" option. I think the reason is that the parallel apply worker could re-read the subscription info earlier than the leader worker; since parallel apply workers don't exit on option changes (see apply_worker_exit()), it updated MySubscription->messages to false and then processed an in-flight MESSAGE sent by the leader, triggering this error. Maybe we can skip the !MySubscription->messages check in parallel apply workers to avoid this. 2. The ordering of the "submessages" column in catalogs.sgml (and system_views.sql) differs from pg_subscription.h, where "submessages" is placed before "subconflictlogdest". -- Best Regards, Zhijie Hou