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


Reply via email to