Ensure that pgstat knowns about XL background processes.
authorPavan Deolasee <[email protected]>
Wed, 14 Jun 2017 06:36:23 +0000 (12:06 +0530)
committerPavan Deolasee <[email protected]>
Wed, 14 Jun 2017 06:36:23 +0000 (12:06 +0530)
XL has two background processes of its own, the cluster monitor process and the
pooler process. This patch ensures that pgstat is aware of these additional
built-in background processes.

src/backend/postmaster/pgstat.c
src/include/pgstat.h

index 008502e48c4eef352fc022940e16682e68d238c9..288eb8efc6490f517c594124787bbfbc67bd86e5 100644 (file)
@@ -2931,6 +2931,12 @@ pgstat_bestart(void)
                        case WalReceiverProcess:
                                beentry->st_backendType = B_WAL_RECEIVER;
                                break;
+                       case PoolerProcess:
+                               beentry->st_backendType = B_PGXL_POOLER;
+                               break;
+                       case ClusterMonitorProcess:
+                               beentry->st_backendType = B_PGXL_CLUSTER_MONITOR;
+                               break;
                        default:
                                elog(FATAL, "unrecognized process type: %d",
                                         (int) MyAuxProcType);
@@ -4121,6 +4127,12 @@ pgstat_get_backend_desc(BackendType backendType)
                case B_WAL_WRITER:
                        backendDesc = "walwriter";
                        break;
+               case B_PGXL_POOLER:
+                       backendDesc = "pooler";
+                       break;
+               case B_PGXL_CLUSTER_MONITOR:
+                       backendDesc = "cluster monitor";
+                       break;
        }
 
        return backendDesc;
index 5f58effe6c35e2a643ab3fbcce02168167b33a75..ca40c572db175616952972db23182b6cdd48be28 100644 (file)
@@ -711,7 +711,9 @@ typedef enum BackendType
        B_STARTUP,
        B_WAL_RECEIVER,
        B_WAL_SENDER,
-       B_WAL_WRITER
+       B_WAL_WRITER,
+       B_PGXL_CLUSTER_MONITOR,
+       B_PGXL_POOLER
 } BackendType;