--- a/src/monitor/pg_auto_failover.c
+++ b/src/monitor/pg_auto_failover.c
@@ -35,7 +35,7 @@
 #include "tcop/utility.h"
 
 
-ProcessUtility_hook_type PreviousProcessUtility_hook = NULL;
+static ProcessUtility_hook_type PreviousProcessUtility_hook = NULL;
 
 
 #if PG_VERSION_NUM >= 150000
--- a/src/monitor/node_metadata.c
+++ b/src/monitor/node_metadata.c
@@ -19,6 +19,7 @@
 /* list_qsort is only in Postgres 11 and 12 */
 #include "version_compat.h"
 
+#include "group_state_machine.h"
 #include "health_check.h"
 #include "metadata.h"
 #include "node_metadata.h"
