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:10 +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 a57b2edf17b7070ea5d5d3df136eda2e5ddb768b..91bcfafb21a202b3eac56b70883370aa592cb652 100644 (file)
@@ -1371,7 +1371,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.