summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaiki Koshino2025-10-14 00:59:39 +0000
committerTaiki Koshino2025-10-14 02:08:53 +0000
commitb286ce29a0718998f8e1825a6a2d06b6777eb2f0 (patch)
tree49b89129da2fe861b351cd0447686394efc16507
parent97ab3f1257c6fe0635281f31e8beaf8850bde882 (diff)
Rename 'logdir' parameter to 'work_dir'.
Previously, the directory for storing pgpool_status and lock files was specified by the logdir parameter. However, since the name logdir was confusing, the parameter has been renamed to work_dir for clarity.
-rw-r--r--doc.ja/src/sgml/misc-config.sgml12
-rw-r--r--doc.ja/src/sgml/release-3.6.sgml2
-rw-r--r--doc.ja/src/sgml/release-3.7.sgml2
-rw-r--r--doc.ja/src/sgml/release-4.0.sgml2
-rw-r--r--doc/src/sgml/misc-config.sgml8
-rw-r--r--doc/src/sgml/release-3.6.sgml2
-rw-r--r--doc/src/sgml/release-3.7.sgml2
-rw-r--r--doc/src/sgml/release-4.0.sgml2
-rw-r--r--src/config/pool_config_variables.c36
-rw-r--r--src/include/pool_config.h2
-rw-r--r--src/main/health_check.c2
-rw-r--r--src/main/pgpool_main.c6
-rw-r--r--src/query_cache/pool_memqcache.c2
-rw-r--r--src/sample/pgpool.conf.sample-stream4
-rw-r--r--src/utils/pool_process_reporting.c6
-rw-r--r--src/watchdog/watchdog.c2
16 files changed, 62 insertions, 30 deletions
diff --git a/doc.ja/src/sgml/misc-config.sgml b/doc.ja/src/sgml/misc-config.sgml
index 37dcf0b54..3a0e2d37c 100644
--- a/doc.ja/src/sgml/misc-config.sgml
+++ b/doc.ja/src/sgml/misc-config.sgml
@@ -282,13 +282,13 @@
</listitem>
</varlistentry>
- <varlistentry id="guc-logdir" xreflabel="logdir">
- <term><varname>logdir</varname> (<type>string</type>)
+ <varlistentry id="guc-work-dir" xreflabel="work_dir">
+ <term><varname>work_dir</varname> (<type>string</type>)
<indexterm>
<!--
- <primary><varname>logdir</varname> configuration parameter</primary>
+ <primary><varname>work_dir</varname> configuration parameter</primary>
-->
- <primary><varname>logdir</varname> 設定パラメータ</primary>
+ <primary><varname>work_dir</varname> 設定パラメータ</primary>
</indexterm>
</term>
<listitem>
@@ -338,7 +338,7 @@
enables the testing facility of health checking. In this case the
health check process looks
into <filename>backend_down_request</filename>
- under <xref linkend="guc-logdir">. The file may contain multiple
+ under <xref linkend="guc-work-dir">. The file may contain multiple
lines, and each line corresponds to each backend. A line in the
file starts with backend id (must be a decimal number starting
with zero), then a TAB, and ends with "down". The backend is
@@ -348,7 +348,7 @@
repeating failovers.
-->
onにすると、ヘルスチェックのテスト機能が有効になります。
- この場合、ヘルスチェックプロセスは<xref linkend="guc-logdir">の下にある<filename>backend_down_request</filename>を参照します。
+ この場合、ヘルスチェックプロセスは<xref linkend="guc-work-dir">の下にある<filename>backend_down_request</filename>を参照します。
このファイルは、複数の行から構成され、各行は各々のバックエンドに対応します。
各行はバックエンドID(ゼロから始まる十進数でなければなりません)で始まり、続いてタブ、最後に"down"で終わります。
そのバックエンドはダウン状態と見なされ、<productname>Pgpool-II</productname>はフェイルオーバを開始します。
diff --git a/doc.ja/src/sgml/release-3.6.sgml b/doc.ja/src/sgml/release-3.6.sgml
index f0c9e9560..5412250e5 100644
--- a/doc.ja/src/sgml/release-3.6.sgml
+++ b/doc.ja/src/sgml/release-3.6.sgml
@@ -2205,7 +2205,7 @@
<!--
Doc: fix typo in logdir description. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=453">bug 453</ulink>)(Tatsuo Ishii)
-->
- Doc: <xref linkend="GUC-LOGDIR">に関するドキュメントのタイポを修正しました。(<ulink url="http://www.pgpool.net/mantisbt/view.php?id=453">bug 453</ulink>)(Tatsuo Ishii)
+ Doc: <link linkend="GUC-WORK-DIR">logdir</link>に関するドキュメントのタイポを修正しました。(<ulink url="http://www.pgpool.net/mantisbt/view.php?id=453">bug 453</ulink>)(Tatsuo Ishii)
</para>
</listitem>
diff --git a/doc.ja/src/sgml/release-3.7.sgml b/doc.ja/src/sgml/release-3.7.sgml
index 47cc2e0a6..b84b5188f 100644
--- a/doc.ja/src/sgml/release-3.7.sgml
+++ b/doc.ja/src/sgml/release-3.7.sgml
@@ -3228,7 +3228,7 @@
<!--
Doc: fix typo in logdir description. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=453">bug 453</ulink>)(Tatsuo Ishii)
-->
- Doc: <xref linkend="GUC-LOGDIR">に関するドキュメントのタイポを修正しました。(<ulink url="http://www.pgpool.net/mantisbt/view.php?id=453">bug 453</ulink>)(Tatsuo Ishii)
+ Doc: <link linkend="GUC-WORK-DIR">logdir</link>に関するドキュメントのタイポを修正しました。(<ulink url="http://www.pgpool.net/mantisbt/view.php?id=453">bug 453</ulink>)(Tatsuo Ishii)
</para>
</listitem>
diff --git a/doc.ja/src/sgml/release-4.0.sgml b/doc.ja/src/sgml/release-4.0.sgml
index 99785620b..d75b3bbb6 100644
--- a/doc.ja/src/sgml/release-4.0.sgml
+++ b/doc.ja/src/sgml/release-4.0.sgml
@@ -4260,7 +4260,7 @@
<!--
Doc: fix typo in logdir description. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=453">bug 453</ulink>)(Tatsuo Ishii)
-->
- Doc: <xref linkend="GUC-LOGDIR">に関するドキュメントのタイポを修正しました。(<ulink url="http://www.pgpool.net/mantisbt/view.php?id=453">bug 453</ulink>)(Tatsuo Ishii)
+ Doc: <link linkend="GUC-WORK-DIR">logdir</link>に関するドキュメントのタイポを修正しました。(<ulink url="http://www.pgpool.net/mantisbt/view.php?id=453">bug 453</ulink>)(Tatsuo Ishii)
</para>
</listitem>
diff --git a/doc/src/sgml/misc-config.sgml b/doc/src/sgml/misc-config.sgml
index eb48b99f7..d4c20fd99 100644
--- a/doc/src/sgml/misc-config.sgml
+++ b/doc/src/sgml/misc-config.sgml
@@ -260,10 +260,10 @@
</listitem>
</varlistentry>
- <varlistentry id="guc-logdir" xreflabel="logdir">
- <term><varname>logdir</varname> (<type>string</type>)
+ <varlistentry id="guc-work-dir" xreflabel="work_dir">
+ <term><varname>work_dir</varname> (<type>string</type>)
<indexterm>
- <primary><varname>logdir</varname> configuration parameter</primary>
+ <primary><varname>work_dir</varname> configuration parameter</primary>
</indexterm>
</term>
<listitem>
@@ -298,7 +298,7 @@
enables the testing facility of health checking. In this case the
health check process looks
into <filename>backend_down_request</filename>
- under <xref linkend="guc-logdir">. The file may contain multiple
+ under <xref linkend="guc-work-dir">. The file may contain multiple
lines, and each line corresponds to each backend. A line in the
file starts with backend id (must be a decimal number starting
with zero), then a TAB, and ends with "down". The backend is
diff --git a/doc/src/sgml/release-3.6.sgml b/doc/src/sgml/release-3.6.sgml
index 1869c2774..b92c24634 100644
--- a/doc/src/sgml/release-3.6.sgml
+++ b/doc/src/sgml/release-3.6.sgml
@@ -1741,7 +1741,7 @@
2019-01-03 [79ef2b0]
-->
<para>
- Doc: fix typo in <xref linkend="GUC-LOGDIR"> description. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=453">bug 453</ulink>) (Tatsuo Ishii)
+ Doc: fix typo in <link linkend="GUC-WORK-DIR">logdir</link> description. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=453">bug 453</ulink>) (Tatsuo Ishii)
</para>
</listitem>
diff --git a/doc/src/sgml/release-3.7.sgml b/doc/src/sgml/release-3.7.sgml
index fa26fec97..87a13b25a 100644
--- a/doc/src/sgml/release-3.7.sgml
+++ b/doc/src/sgml/release-3.7.sgml
@@ -2691,7 +2691,7 @@
2019-01-03 [520649b]
-->
<para>
- Doc: fix typo in <xref linkend="GUC-LOGDIR"> description. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=453">bug 453</ulink>) (Tatsuo Ishii)
+ Doc: fix typo in <link linkend="GUC-WORK-DIR">logdir</link> description. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=453">bug 453</ulink>) (Tatsuo Ishii)
</para>
</listitem>
diff --git a/doc/src/sgml/release-4.0.sgml b/doc/src/sgml/release-4.0.sgml
index 4160ab654..62439b143 100644
--- a/doc/src/sgml/release-4.0.sgml
+++ b/doc/src/sgml/release-4.0.sgml
@@ -3707,7 +3707,7 @@
2019-01-03 [de632ca]
-->
<para>
- Doc: fix typo in <xref linkend="GUC-LOGDIR"> description. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=453">bug 453</ulink>) (Tatsuo Ishii)
+ Doc: fix typo in <link linkend="GUC-WORK-DIR">logdir</link> description. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=453">bug 453</ulink>) (Tatsuo Ishii)
</para>
</listitem>
diff --git a/src/config/pool_config_variables.c b/src/config/pool_config_variables.c
index 5bbe46d3a..326e3ab3f 100644
--- a/src/config/pool_config_variables.c
+++ b/src/config/pool_config_variables.c
@@ -142,6 +142,7 @@ static bool BackendSlotEmptyCheckFunc(int index);
/*variable custom assign functions */
static bool FailOverOnBackendErrorAssignMessage(ConfigContext scontext, bool newval, int elevel);
static bool DelegateIPAssignMessage(ConfigContext scontext, char *newval, int elevel);
+static bool LogDirAssignMessage(ConfigContext scontext, char *newval, int elevel);
static bool BackendPortAssignFunc(ConfigContext context, int newval, int index, int elevel);
static bool BackendHostAssignFunc(ConfigContext context, char *newval, int index, int elevel);
static bool BackendDataDirAssignFunc(ConfigContext context, char *newval, int index, int elevel);
@@ -1353,13 +1354,24 @@ static struct config_string ConfigureNamesString[] =
{
{"logdir", CFGCXT_INIT, LOGGING_CONFIG,
- "PgPool status file logging directory.",
+ "Old config parameter for work_dir.",
+ CONFIG_VAR_TYPE_STRING, false, VAR_HIDDEN_IN_SHOW_ALL
+ },
+ NULL,
+ "",
+ LogDirAssignMessage, NULL, NULL, NULL
+ },
+
+ {
+ {"work_dir", CFGCXT_INIT, LOGGING_CONFIG,
+ "directory to create pgpool_status and lock files.",
CONFIG_VAR_TYPE_STRING, false, 0
},
- &g_pool_config.logdir,
+ &g_pool_config.work_dir,
DEFAULT_LOGDIR,
NULL, NULL, NULL, NULL
},
+
{
{"log_directory", CFGCXT_RELOAD, LOGGING_CONFIG,
"directory where log files are written.",
@@ -4831,6 +4843,26 @@ DelegateIPAssignMessage(ConfigContext scontext, char *newval, int elevel)
}
/*
+ * Throws warning for if someone uses the removed logdir
+ * configuration parameter and set the value to work_dir
+ */
+static bool
+LogDirAssignMessage(ConfigContext scontext, char *newval, int elevel)
+{
+ if (scontext != CFGCXT_BOOT)
+ ereport(WARNING,
+ (errmsg("logdir is changed to work_dir"),
+ errdetail("if logdir is specified, the value will be set to work_dir")));
+ if (g_pool_config.work_dir)
+ pfree(g_pool_config.work_dir);
+ if (newval)
+ g_pool_config.work_dir = pstrdup(newval);
+ else
+ g_pool_config.work_dir = NULL;
+ return true;
+}
+
+/*
* Check DB node spec. node spec should be either "primary", "standby" or
* numeric DB node id.
*/
diff --git a/src/include/pool_config.h b/src/include/pool_config.h
index be82750e5..7cf5460f3 100644
--- a/src/include/pool_config.h
+++ b/src/include/pool_config.h
@@ -261,7 +261,7 @@ typedef struct
int authentication_timeout; /* maximum time in seconds to complete
* client authentication */
int max_pool; /* max # of connection pool per child */
- char *logdir; /* logging directory */
+ char *work_dir; /* directory to create pgpool_status and lock files */
char *log_destination_str; /* log destination: stderr and/or
* syslog */
int log_destination; /* log destination */
diff --git a/src/main/health_check.c b/src/main/health_check.c
index 68b3ced74..0c72c0a72 100644
--- a/src/main/health_check.c
+++ b/src/main/health_check.c
@@ -620,7 +620,7 @@ check_backend_down_request(int node, bool done_requests)
if (backend_down_request_file[0] == '\0')
{
snprintf(backend_down_request_file, sizeof(backend_down_request_file),
- "%s/%s", pool_config->logdir, BACKEND_DOWN_REQUEST_FILE);
+ "%s/%s", pool_config->work_dir, BACKEND_DOWN_REQUEST_FILE);
}
fd = fopen(backend_down_request_file, "r");
diff --git a/src/main/pgpool_main.c b/src/main/pgpool_main.c
index bf7e49ef6..4d88c5815 100644
--- a/src/main/pgpool_main.c
+++ b/src/main/pgpool_main.c
@@ -523,7 +523,7 @@ PgpoolMain(bool discard_status, bool clear_memcache_oidmaps)
int lfd;
snprintf(query_cache_lock_path, sizeof(query_cache_lock_path),
- "%s/%s", pool_config->logdir, QUERY_CACHE_LOCK_FILE);
+ "%s/%s", pool_config->work_dir, QUERY_CACHE_LOCK_FILE);
lfd = open(query_cache_lock_path, O_CREAT | O_TRUNC | O_WRONLY, S_IRUSR | S_IWUSR);
if (lfd == -1)
{
@@ -3204,7 +3204,7 @@ read_status_file(bool discard_status)
pool_set_backend_status_changed_time(i);
}
- snprintf(fnamebuf, sizeof(fnamebuf), "%s/%s", pool_config->logdir, STATUS_FILE_NAME);
+ snprintf(fnamebuf, sizeof(fnamebuf), "%s/%s", pool_config->work_dir, STATUS_FILE_NAME);
fd = fopen(fnamebuf, "r");
if (!fd)
{
@@ -3391,7 +3391,7 @@ write_status_file(void)
return 0;
}
- snprintf(fnamebuf, sizeof(fnamebuf), "%s/%s", pool_config->logdir, STATUS_FILE_NAME);
+ snprintf(fnamebuf, sizeof(fnamebuf), "%s/%s", pool_config->work_dir, STATUS_FILE_NAME);
fd = fopen(fnamebuf, "w");
if (!fd)
{
diff --git a/src/query_cache/pool_memqcache.c b/src/query_cache/pool_memqcache.c
index dc2ce911e..c8a94cc99 100644
--- a/src/query_cache/pool_memqcache.c
+++ b/src/query_cache/pool_memqcache.c
@@ -3137,7 +3137,7 @@ pool_shmem_lock(POOL_MEMQ_LOCK_TYPE type)
{
char *path;
- path = psprintf("%s/%s", pool_config->logdir, QUERY_CACHE_LOCK_FILE);
+ path = psprintf("%s/%s", pool_config->work_dir, QUERY_CACHE_LOCK_FILE);
memq_lock_fd = open(path, O_CREAT | O_TRUNC | O_WRONLY, S_IRUSR | S_IWUSR);
if (memq_lock_fd == -1)
{
diff --git a/src/sample/pgpool.conf.sample-stream b/src/sample/pgpool.conf.sample-stream
index a7eb594c9..dcccb57a6 100644
--- a/src/sample/pgpool.conf.sample-stream
+++ b/src/sample/pgpool.conf.sample-stream
@@ -351,8 +351,8 @@ backend_clustering_mode = streaming_replication
# location of pgpool.conf file or
# as an absolute path
# (change requires restart)
-#logdir = '/tmp'
- # Directory of pgPool status file
+#work_dir = '/tmp'
+ # Directory for pgpool_status and lock files.
# (change requires restart)
diff --git a/src/utils/pool_process_reporting.c b/src/utils/pool_process_reporting.c
index 99c0cc006..e4fcf4457 100644
--- a/src/utils/pool_process_reporting.c
+++ b/src/utils/pool_process_reporting.c
@@ -507,9 +507,9 @@ get_config(int *nrows)
StrNCpy(status[i].desc, "path to pid file", POOLCONFIG_MAXDESCLEN);
i++;
- StrNCpy(status[i].name, "logdir", POOLCONFIG_MAXNAMELEN);
- snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->logdir);
- StrNCpy(status[i].desc, "PgPool status file logging directory", POOLCONFIG_MAXDESCLEN);
+ StrNCpy(status[i].name, "work_dir", POOLCONFIG_MAXNAMELEN);
+ snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->work_dir);
+ StrNCpy(status[i].desc, "directory to create pgpool_status and lock files ", POOLCONFIG_MAXDESCLEN);
i++;
/* CONNECTION POOLING */
diff --git a/src/watchdog/watchdog.c b/src/watchdog/watchdog.c
index 48d05b1f8..663e77240 100644
--- a/src/watchdog/watchdog.c
+++ b/src/watchdog/watchdog.c
@@ -8577,7 +8577,7 @@ load_watchdog_debug_test_option(void)
if (wd_debug_request_file[0] == '\0')
{
snprintf(wd_debug_request_file, sizeof(wd_debug_request_file),
- "%s/%s", pool_config->logdir, WATCHDOG_DEBUG_FILE);
+ "%s/%s", pool_config->work_dir, WATCHDOG_DEBUG_FILE);
}
fd = fopen(wd_debug_request_file, "r");