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:33:53 +0000 (10:33 +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 e5b7dbbafee0bb0f8a451b9b59e8a548a5d88766..687a4e3c13c6351d0c80b8331636142246f11c00 100644 (file)
@@ -699,7 +699,11 @@ 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);
@@ -2120,5 +2124,3 @@ static int opt_sort(const void *a, const void *b)
 {
        return strcmp( *(char **)a, *(char **)b);
 }
-
-