The new message 'W' to report waited-for XIDs must not be sent to a non-XL
client since it's not capable of handling that and might just cause unpleasant
problems. In fact, we should change 'W' to something else since standard libpq
understands that message and hangs forever expecting more data. With a new
protocol message, it would have failed, thus providing a more user friend
error. But postponing that for now since we should think through implications
of protocol change carefully before doing that.
* subtransactions) had waited-for to the coordinator. The coordinator will
* then forward the list to the GTM who ensures that the logical ordering
* between these transactions and this transaction is correctly followed.
+ *
+ * Non XL clients are not prepared to deal with this message. So ensure we
+ * check for remote end first. It's not enough to check if we're NOT a
+ * local coordinator (as we were doing before) since one might be running
+ * pg_restore to create a new coordinator or a datanode in --restoremode.
*/
- if (whereToSendOutput == DestRemote && !IS_PGXC_LOCAL_COORDINATOR)
+ if (whereToSendOutput == DestRemote && !IsConnFromApp())
{
if (s->waitedForXidsCount > 0)
{