Fix to compare wrong variable, when old pgpool_status file read.
authorTakuma Hoshiai <hoshiai@sraoss.co.jp>
Wed, 10 Apr 2019 02:53:46 +0000 (11:53 +0900)
committerTakuma Hoshiai <hoshiai@sraoss.co.jp>
Wed, 10 Apr 2019 02:53:46 +0000 (11:53 +0900)
Pgpool-II 3.4 or later, pgpool_status format changed, and format both old and new is supported.
Pgpool might read status in file incorrectly, when old format is reading by Pgpool.

This is rare case, and noproblem if it is happend.

src/main/pgpool_main.c

index 0a03f77984dc164034566196859c1344d5be6dfc..a3f2a98b7aa005fe30943a93a7367359b407a25f 100644 (file)
@@ -2943,8 +2943,8 @@ static int read_status_file(bool discard_status)
                                ereport(LOG,
                                                (errmsg("read_status_file: %d th backend is set to down status", i)));
                        }
-                       else if (BACKEND_INFO(i).backend_status == CON_CONNECT_WAIT ||
-                                        BACKEND_INFO(i).backend_status == CON_UP)
+                       else if (backend_rec.status[i] == CON_CONNECT_WAIT ||
+                                        backend_rec.status[i] == CON_UP)
                        {
                                BACKEND_INFO(i).backend_status = CON_CONNECT_WAIT;
                                (void)write_status_file();