Enhance error message while processing parse message.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Sat, 12 Mar 2022 04:33:42 +0000 (13:33 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Sat, 12 Mar 2022 04:38:22 +0000 (13:38 +0900)
In non-streaming replication mode, a sync message is sent to backend
after a parse message is sent to backend, expecting to get a ready for
query message.  If different message is returned, pgpool will complain
that. This commit adds more information: the message kind returned and
the backend node id.

src/protocol/pool_proto_modules.c

index dfe4f065bea44b01d6fcf1071b79fff14329cf21..8e4895e9658f949bcee2c858cb0d6269f3d20d00 100644 (file)
@@ -1242,7 +1242,7 @@ Parse(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend,
                        if (kind != 'Z')
                                ereport(ERROR,
                                                (errmsg("unable to parse the query"),
-                                                errdetail("invalid read kind")));
+                                                errdetail("invalid read kind \"%c\" returned from backend %d after Sync message sent", kind, i)));
 
                        /*
                         * SYNC message returns "Ready for Query" message.