Enhance debug message upon receiving startup packet.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Tue, 16 Mar 2021 01:27:22 +0000 (10:27 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Tue, 16 Mar 2021 01:37:44 +0000 (10:37 +0900)
While processing a startup packet, database name, user name and
application name are printed in DEBUG1, but other guc variables (if
any) were not printed. This is not helpful when studying errors like
"connection exists but startup packet length is not identical" problem
(see https://www.pgpool.net/mantisbt/view.php?id=696). With this
commit guc variables are now printed something like:

2021-03-16 10:21:32: child pid 5155: DEBUG:  reading startup packet
2021-03-16 10:21:32: child pid 5155: DETAIL:  guc name: client_encoding value: UTF8

src/protocol/child.c

index 1533b02de7019c41788687cb16ada6c20f613b59..a2faea8785b6752221d03651f5577ed4aae53530 100644 (file)
@@ -645,7 +645,11 @@ static StartupPacket *read_startup_packet(POOL_CONNECTION *cp)
                                }
                                else
                                {
+                                       ereport(DEBUG1,
+                                                       (errmsg("reading startup packet"),
+                                                        errdetail("guc name: %s value: %s", p, p+strlen(p)+1)));
                                        p += (strlen(p) + 1);
+
                                }
 
                                p += (strlen(p) + 1);