From 2d73b1f89b489b4064c80f12ea8423ae096c142c Mon Sep 17 00:00:00 2001 From: Nozomi Anzai Date: Wed, 2 Dec 2015 14:44:43 +0900 Subject: [PATCH] Add new parameters in 3.5 --- common.php | 744 +++--- config.php | 47 +- definePgpoolConfParam.php | 211 +- innerSystemCatalog.php | 31 +- lang/en.lang.php | 25 +- lang/ja.lang.php | 20 +- libs/plugins/function.custom_input.php | 29 + libs/plugins/function.custom_radio_bool.php | 30 + libs/plugins/function.custom_select.php | 26 + .../function.custom_table_pgconfig.php | 25 + pgconfig.php | 208 +- queryCache.php | 16 +- status.php | 32 +- templates/config.tpl | 208 +- templates/elements/pgconfig_submenu.tpl | 30 + templates/pgconfig.tpl | 2124 ++++------------- version.php | 2 +- 17 files changed, 1466 insertions(+), 2342 deletions(-) create mode 100644 libs/plugins/function.custom_input.php create mode 100644 libs/plugins/function.custom_radio_bool.php create mode 100644 libs/plugins/function.custom_select.php create mode 100644 libs/plugins/function.custom_table_pgconfig.php create mode 100644 templates/elements/pgconfig_submenu.tpl diff --git a/common.php b/common.php index 759bb26..49996b1 100644 --- a/common.php +++ b/common.php @@ -19,39 +19,33 @@ * is" without express or implied warranty. * * @author Ryuma Ando - * @copyright 2003-2013 PgPool Global Development Group + * @copyright 2003-2015 PgPool Global Development Group * @version SVN: $Id$ */ require_once('version.php'); require_once('libs/Smarty.class.php'); +require_once('conf/pgmgt.conf.php'); require_once('bootstrap.php'); +require_once('definePgpoolConfParam.php'); error_reporting(E_ALL); -function versions() -{ - return array('3.4', '3.3', '3.2', '3.1', '3.0', - '2.3', '2.2', '2.1', '2.0'); -} - session_start(); /** * Initialize Smartry */ $tpl = new Smarty(); -//$tpl->error_reporting = E_ALL & ~E_NOTICE; +$tpl->error_reporting = E_ALL & ~E_NOTICE; $tpl->assign('version', $version); -if (!file_exists('conf/pgmgt.conf.php')) { +if (! file_exists('conf/pgmgt.conf.php')) { include('lang/en.lang.php'); $tpl->assign('message', $message); $tpl->display('pgmgtNotFound.tpl'); exit(); } -require_once('conf/pgmgt.conf.php'); - /** * Check login */ @@ -60,7 +54,7 @@ $tpl->assign('isHelp', FALSE); // If old pgmgt.conf is used, _PGPOOL2_VERSION doen't exist. // This defined var exists from pgpoolAdmin 3.2. -if (!defined('_PGPOOL2_VERSION')) { +if (! defined('_PGPOOL2_VERSION')) { $versions = versions(); define('_PGPOOL2_VERSION', $versions[0]); } @@ -69,21 +63,17 @@ if (!defined('_PGPOOL2_VERSION')) { * Check pgmgt.conf.php Parameter */ $errors = array(); -if (!defined('_PGPOOL2_LANG') || - !defined('_PGPOOL2_VERSION') || - !defined('_PGPOOL2_CONFIG_FILE') || - !defined('_PGPOOL2_PASSWORD_FILE') || - !defined('_PGPOOL2_COMMAND') || - !defined('_PGPOOL2_PCP_DIR') || - !defined('_PGPOOL2_PCP_HOSTNAME') || - !defined('_PGPOOL2_STATUS_REFRESH_TIME')) +if (! defined('_PGPOOL2_LANG') || + ! defined('_PGPOOL2_VERSION') || + ! defined('_PGPOOL2_CONFIG_FILE') || + ! defined('_PGPOOL2_PASSWORD_FILE') || + ! defined('_PGPOOL2_COMMAND') || + ! defined('_PGPOOL2_PCP_DIR') || + ! defined('_PGPOOL2_PCP_HOSTNAME') || + ! defined('_PGPOOL2_STATUS_REFRESH_TIME')) { include('lang/en.lang.php'); - $tpl->assign('message', $message); - $errorCode = 'e7'; - $tpl->assign('errorCode', $errorCode); - $tpl->display('error.tpl'); - exit(); + errorPage('e7'); } /** @@ -99,10 +89,7 @@ while ($file_name = readdir( $res_dir )) { $messageList[$message['lang']] = $message['strLang']; } else { - $errorCode = 'e2'; - $tpl->assign('errorCode', $errorCode); - $tpl->display('error.tpl'); - exit(); + errorPage('e2'); } } } @@ -117,34 +104,22 @@ include('lang/' . $lang . '.lang.php'); $tpl->assign('message', $message); $_SESSION[SESSION_MESSAGE] = $message; +/* --------------------------------------------------------------------- */ +/* function (DB) */ +/* --------------------------------------------------------------------- */ + /** * Open databse connection - * - * @param array $param - * @return resource */ -function openDBConnection($param) +function openDBConnection($arr) { - $host = $param['hostname']; - $port = $param['port']; - $dbname = $param['dbname']; - $user = $param['user']; - $password = $param['password']; - - if ($host != '') { - $conStr = "host=$host port=$port dbname=$dbname user=$user password=$password" ; - } else { - $conStr = "port=$port dbname=$dbname user=$user password=$password" ; - } - - $con = @pg_connect($conStr); - return $con; + $conStr = generateConstr($arr); + $conn = @pg_connect($conStr); + return $conn; } /** * Close database connection - * - * @param bool */ function closeDBConnection($connection) { @@ -153,10 +128,6 @@ function closeDBConnection($connection) /** * Execute query - * - * @param resource $conn - * @param string $sql - * @return resource */ function execQuery($conn, $sql) { @@ -168,105 +139,65 @@ function execQuery($conn, $sql) return $rs; } -/** - * Select language registred in conf directory - * - * @return string - */ -function selectLanguage($selectLang, $messageList) -{ - if ($selectLang == NULL || $selectLang == 'auto') { - if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { - $acceptLanguages = $_SERVER['HTTP_ACCEPT_LANGUAGE']; - } else { - $acceptLanguages = FALSE; - } - - $lang = NULL; - - if ($acceptLanguages == FALSE) { - $lang = 'en'; - - } else { - $langList = explode(',|;', $acceptLanguages); - foreach ($langList as $acceptLanguage) { - foreach (array_keys($messageList) as $messageLanguage) { - if ($acceptLanguage == $messageLanguage ) { - $lang = $messageLanguage; - break; - } - } - if ($lang != NULL) { break; } - } - } - } else { - $lang = $selectLang; - } - - $_SESSION[SESSION_LANG] = $lang; - return $lang; -} - -/** - * Whether pgpool is operating in the parallel mode or not? - * - * @return bool - */ -function isParallelMode() -{ - $params = readConfigParams(array('parallel_mode')); - - if (isTrue($params['parallel_mode'])) { - return TRUE; - } else { - return FALSE; - } -} - /** * Confirmation whether node is active or is not. - * - * @return bool */ -function NodeActive($num) +function NodeActive($nodeNum) { - $conn = @pg_connect(conStr($num)); + $params = readConfigParams(array( + 'backend_hostname', 'backend_port', 'backend_weight', + 'health_check_user', 'health_check_password' + )); + + $conn = openDBConnection(array( + 'host' => $params['backend_hostname'][$nodeNum], + 'port' => $params['backend_port'][$nodeNum], + 'dbname' => 'template1', + 'user' => $params['health_check_user'], + 'password' => $params['health_check_password'], + )); if ($conn == FALSE) { - @pg_close($conn); return FALSE; } else { - @pg_close($conn); + closeDBConnection($conn); return TRUE; } } /** * Confirmation whether node is act as a standby server - * - * @return integer */ -function NodeStandby($num) +function NodeStandby($nodeNum) { if (isMasterSlaveMode() == FALSE || useStreaming() == FALSE) { return -1; } - $conn = @pg_connect(conStr($num, 'stream')); + $params = readConfigParams(array( + 'backend_hostname', 'backend_port', + 'sr_check_user','sr_check_password' + )); + + $conn = openDBConnection(array( + 'host' => $params['backend_hostname'][$nodeNum], + 'port' => $params['backend_port'][$nodeNum], + 'dbname' => 'template1', + 'user' => $params['sr_check_user'], + 'password' => $params['sr_check_password'], + )); if ($conn == FALSE) { - @pg_close($conn); return -1; } $result = pg_query($conn, 'SELECT pg_is_in_recovery()'); - if (!pg_result_status($result) == PGSQL_TUPLES_OK) { - @pg_close($conn); + if (! pg_result_status($result) == PGSQL_TUPLES_OK) { + closeDBConnection($conn); return -1; } $rr = pg_fetch_array($result); - if ($rr[0][0] == 't') { $r = 1; } else { @@ -274,294 +205,286 @@ function NodeStandby($num) } @pg_free_result($result); - @pg_close($conn); + closeDBConnection($conn); return $r; } /** - * Create connection str for pg_connect() + * Get if loginUser is super user */ -function conStr($num, $mode = NULL) +function isSuperUser($user_name) { - // check user info - if ($mode == 'login') { - $user = $_SESSION[SESSION_LOGIN_USER]; - $password = $_SESSION[SESSION_LOGIN_USER_PASSWORD]; - - } elseif ($mode == 'stream' && paramExists('sr_check_user')) { - $params = readConfigParams(array('sr_check_user', - 'sr_check_password')); - $user = $params['sr_check_user']; - $password = $params['sr_check_password']; + $params = readConfigParams(array('port')); + $conn = openDBConnection(array( + 'port' => $params['port'], + 'dbname' => 'template1', + 'user' => $_SESSION[SESSION_LOGIN_USER], + 'password' => $_SESSION[SESSION_LOGIN_USER_PASSWORD], + )); - } else { - $params = readConfigParams(array('health_check_user', - 'health_check_password')); - $user = $params['health_check_user']; - $password = (isset($params['health_check_user'])) ? - $params['health_check_password'] : NULL; + if ($conn == FALSE) { + return NULL; } - // backend info - $params = readConfigParams(array('backend_hostname', - 'backend_port', - 'backend_weight')); - $conStr = array(); - if ($params['backend_hostname'][$num] != '') { - $conStr[] = "host='{$params['backend_hostname'][$num]}'"; + $result = pg_query($conn, "SELECT usesuper FROM pg_user WHERE usename = '{$user_name}'"); + if (! pg_result_status($result) == PGSQL_TUPLES_OK) { + closeDBConnection($conn); + return NULL; } - $conStr[] = "port='{$params['backend_port'][$num]}'"; - $conStr[] = "dbname='template1'"; - $conStr[] = "user='{$user}'"; - $conStr[] = "password='{$password}'"; - $conStr = implode($conStr, ' '); - return $conStr; -} + $rr = pg_fetch_array($result); + $rtn = (isset($rr['usesuper']) && $rr['usesuper'] == 't') ? 'yes' : 'no'; -/** - * Existence confirmation of pgpool.pid - * - * @return bool - */ -function DoesPgpoolPidExist() -{ - $params = readConfigParams(array('pid_file_name')); - $pidFile = $params['pid_file_name']; - if (file_exists($pidFile) ) { - return TRUE; - } - return FALSE; -} + @pg_free_result($result); + closeDBConnection($conn); -/** - * Existence confirmation of pgpool.pid - * - * @return bool - */ -function readLogDir() -{ + $_SESSION[SESSION_IS_SUPER_USER] = $rtn; - $params = readConfigParams(array('logdir')); - return $params['logdir']; + return $rtn; } /** - * Whether pgpool is operating in the replication mode or not? - * - * @return bool + * Create connection str for pg_connect() */ -function isReplicationMode() -{ - $params = readConfigParams(array('replication_mode')); - if (isTrue($params['replication_mode'])) { - return TRUE; - } else { - return FALSE; - } -} - -/** - * Whether pgpool is operating in the master slave mode or not? - * - * @return bool - */ -function isMasterSlaveMode() +function generateConstr($params) { - $params = readConfigParams(array('master_slave_mode')); - - if (isTrue($params['master_slave_mode'])) { - return TRUE; - } else { - return FALSE; + $arr = array(); + foreach ($params as $param => $value) { + if ($value == '') { continue; } + switch ($param) { + case 'host': + case 'port': + case 'dbname': + case 'user': + case 'password': + $arr[] = "{$param}='{$value}'"; + } } + $conStr = implode(' ', $arr); + + return $conStr; } +/* --------------------------------------------------------------------- */ +/* function (pgpool) */ +/* --------------------------------------------------------------------- */ + /** - * Whether pgpool is using stream sub mode in master slave mode or not? - * - * @return bool + * Check if pgpool.pid exists */ -function useStreaming() +function DoesPgpoolPidExist() { - $params = readConfigParams(array('master_slave_sub_mode')); - - if (isMasterSlaveMode() && $params['master_slave_sub_mode'] == 'stream') { + $params = readConfigParams(array('pid_file_name')); + $pidFile = $params['pid_file_name']; + if (file_exists($pidFile) ) { return TRUE; - } else { - return FALSE; } + return FALSE; } +/* --------------------------------------------------------------------- */ +/* function (parameters) */ +/* --------------------------------------------------------------------- */ + /** - * Whether pgpool uses syslog or not? - * - * @return bool + * Get the value of "logdir" */ -function useSyslog() +function readLogDir() { - if (!paramExists('log_destination')) { return FALSE; } - - $params = readConfigParams(array('log_destination')); - - if ($params['log_destination'] == 'syslog') { - return TRUE; - } else { - return FALSE; - } + $params = readConfigParams(array('logdir')); + return $params['logdir']; } /** * Read parameters specified in $paramList from pgpool.conf. * If $paramList is not specified, all item is read from pgpool.conf. - * - * @param array $paramList - * @return array */ -function readConfigParams($paramList = FALSE) +function readConfigParams($paramList = array()) { - $results = array(); - $configParam = array(); + $rtn = array(); + global $pgpoolConfigParam, $pgpoolConfigBackendParam , + $pgpoolConfigWdOtherParam, $pgpoolConfigHbDestinationParam; + // Try to read pgpool.conf $configFile = @file(_PGPOOL2_CONFIG_FILE); if ($configFile == FALSE) { $errTpl = new Smarty(); $errTpl->assign('message', $_SESSION[SESSION_MESSAGE]); - $errorCode = 'e4'; - $errTpl->assign('errorCode', $errorCode); - $errTpl->display('error.tpl'); - exit(); + errorPage('e4'); } + // Defined array in definePgpoolConfParam.php + $defines_arr = $pgpoolConfigParam + $pgpoolConfigBackendParam + + $pgpoolConfigWdOtherParam + $pgpoolConfigHbDestinationParam; + + $arr = array(); + // Convert lines in files to array foreach ($configFile as $line_num => $line) { $line = trim($line); - if (preg_match("/^\w/", $line)) { - list($key, $value) = explode("=", $line); - - $key = trim($key); - $value = trim($value); - - // params about backend nodes - if (preg_match("/^backend_hostname/", $key)) { - $num = str_replace('backend_hostname', '', $key); - $configParam['backend_hostname'][$num] = str_replace("'", "", $value); + if (substr($line, 0, 1) == '#' || strpos($line, '=') === FALSE) { + continue; + } - } elseif (preg_match("/^backend_port/", $key)) { - $num = str_replace('backend_port', '', $key); - $configParam['backend_port'][$num] = $value; + list($key, $value) = explode('=', $line); + $key = trim($key); - } elseif (preg_match("/^backend_weight/", $key)) { - $num = str_replace('backend_weight', '', $key); - $configParam['backend_weight'][$num] = $value; + $num = preg_replace('/[^0-9]/', NULL, $key); + $key_wo_num = str_replace($num, NULL, $key); - } elseif (preg_match("/^backend_data_directory/", $key)) { - $num = str_replace('backend_data_directory', '', $key); - $configParam['backend_data_directory'][$num] =str_replace("'", "", $value); + // Ignore params not specified to read + if ($paramList && is_array($paramList) && ! in_array($key_wo_num, $paramList)) { + continue; + } - } elseif (preg_match("/^backend_flag/", $key)) { - $num = str_replace('backend_flag', '', $key); - $configParam['backend_flag'][$num] =str_replace("'", "", $value); + // Remove quotes and comments + $value = trimValue($value); - // params about watchdog monitoring - } elseif (preg_match("/^other_pgpool_hostname/", $key)) { - $num = str_replace('other_pgpool_hostname', '', $key); - $configParam['other_pgpool_hostname'][$num] = str_replace("'", "", $value); + if (! isset($defines_arr[$key_wo_num])) { + continue; - } elseif (preg_match("/^other_pgpool_port/", $key)) { - $num = str_replace('other_pgpool_port', '', $key); - $configParam['other_pgpool_port'][$num] = $value; + // Params with multiple values + // (backend_*, other_pgpool_*, heartbeat_destination_*, heartbeat_device*) + } elseif (isset($defines_arr[$key_wo_num]['multiple']) && + $defines_arr[$key_wo_num]['multiple'] == TRUE) + { + $rtn[$key_wo_num][$num] = $value; - } elseif (preg_match("/^other_wd_port/", $key)) { - $num = str_replace('other_wd_port', '', $key); - $configParam['other_wd_port'][$num] = $value; + } else { + // Ignore param not defined definePgpoolConfParam.php + $rtn[$key_wo_num] = $value; + } + } - // params about watchdog heartbeat - } elseif (preg_match("/^heartbeat_destination_port/", $key)) { - $num = str_replace('heartbeat_destination_port', '', $key); - $configParam['heartbeat_destination_port'][$num] = $value; + // Set default value if there is no line about the param + if ($paramList && is_array($paramList)) { + foreach ($paramList as $key) { + if (! isset($rtn[$key]) || $rtn[$key] == NULL) { + $default_value = $defines_arr[$key]['default']; - } elseif (preg_match("/^heartbeat_destination/", $key)) { - $num = str_replace('heartbeat_destination', '', $key); - $configParam['heartbeat_destination'][$num] = str_replace("'", "", $value); + if (isset($defines_arr[$key]['multiple']) && + $defines_arr[$key]['multiple']) + { + $rtn[$key][0] = $default_value; + } else { + $rtn[$key] = $default_value; + } + } + } - } elseif (preg_match("/^heartbeat_device/", $key)) { - $num = str_replace('heartbeat_device', '', $key); - $configParam['heartbeat_device'][$num] = str_replace("'", "", $value); + } elseif ($defines_arr) { + foreach ($defines_arr as $key => $param_info) { + if (! isset($rtn[$key])) { + $default_value = (isset($defines_arr[$key]['default'])) ? + $defines_arr[$key]['default'] : NULL; - } else { - $configParam[$key] = str_replace("'", "", $value); + if (isset($defines_arr[$key]['multiple']) && + $defines_arr[$key]['multiple']) + { + $rtn[$key][0] = $default_value; + } else { + $rtn[$key] = $default_value; + } } } } - if (is_array($paramList)) { - foreach ($paramList as $key) { - if (isset($configParam[$key])) { - $results[$key] = $configParam[$key]; + return $rtn; +} + +function trimValue($text) +{ + // Remove spaces + $text = trim($text); + + $rtn = ''; + $in_quotes = FALSE; + for ($i = 0; $i < strlen($text); $i++) { + $c = substr($text, $i, 1); + + switch ($c) { + // Ignore "'" + case "'": + if ($in_quotes) { + break 2; } else { - require_once('definePgpoolConfParam.php'); - if(!preg_match("/^backend_hostname/", $key) && - !preg_match("/^backend_port/", $key) && - !preg_match("/^backend_weight/", $key) && - !preg_match("/^backend_data_directory/", $key) && - !preg_match("/^backend_flag/", $key) && - !preg_match("/^other_pgpool_hostname/", $key) && - !preg_match("/^other_pgpool_port/", $key) && - !preg_match("/^other_wd_port/", $key) && - !preg_match("/^heartbeat_destination/", $key) && - !preg_match("/^heartbeat_destination_port/", $key) && - !preg_match("/^heartbeat_device/", $key) - ) - { - if (isset($configParam[$key])) { - $results[$key] = $configParam[$key]['default']; - } - } + $in_quotes = TRUE; + } + break; + + // Ignore "#" comment + case '#': + if (! $in_quotes) { + break; } + break; } - } else { - $results = $configParam; + $rtn .= $c; } - return $results; - + $rtn = trim($rtn, "'"); + return $rtn; } -function isPipe($str) - +/** + * Select language registred in conf directory + */ +function selectLanguage($selectLang, $messageList) { - return (strpos($str, '|') !== FALSE); -} + if ($selectLang == NULL || $selectLang == 'auto') { + if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { + $acceptLanguages = $_SERVER['HTTP_ACCEPT_LANGUAGE']; + } else { + $acceptLanguages = FALSE; + } -function isTrue($value) -{ - return in_array($value, array('on', 'true')); -} + $lang = NULL; -/* check version */ -function hasWatchdog() -{ - return (3.2 <= _PGPOOL2_VERSION); -} + if ($acceptLanguages == FALSE) { + $lang = 'en'; -function hasMemqcache() -{ - return (3.2 <= _PGPOOL2_VERSION); -} -// pgpool has pcp_promote_node ? -function hasPcpPromote() -{ - return (3.1 <= _PGPOOL2_VERSION); + } else { + $langList = explode(',|;', $acceptLanguages); + foreach ($langList as $acceptLanguage) { + foreach (array_keys($messageList) as $messageLanguage) { + if ($acceptLanguage == $messageLanguage ) { + $lang = $messageLanguage; + break; + } + } + if ($lang != NULL) { break; } + } + } + } else { + $lang = $selectLang; + } + + $_SESSION[SESSION_LANG] = $lang; + return $lang; } +/** + * Check if the parameter is used in the specified version + */ function paramExists($param) { $add_version = $del_version = 0; /* Add */ switch ($param) { + // params added in 3.5 + case 'if_cmd_path': + case 'health_check_database': + case 'pcp_listen_addresses': + case 'search_primary_node_timeout': + case 'serialize_accept': + case 'sr_check_database': + case 'wd_de_escalation_command': + case 'wd_ipc_socket_dir': + case 'wd_priority': + $add_version = 3.5; + break; // params added in 3.4 case 'listen_backlog_multiplier': @@ -677,6 +600,11 @@ function paramExists($param) /* Delete */ switch ($param) { + // params deleted in 3.5 + case 'ifconfig_path': + $del_version = 3.5; + break; + // params deleted in 3.4 case 'print_timestamp': case 'parallel_mode': @@ -705,55 +633,165 @@ function paramExists($param) break; } - if ($add_version && $add_version <= _PGPOOL2_VERSION) { + $rtn = TRUE; + if ($add_version && _PGPOOL2_VERSION < $add_version) { + $rtn = FALSE; + } + if ($del_version && $del_version <= _PGPOOL2_VERSION) { + $rtn = FALSE; + } + return $rtn; +} + +/* --------------------------------------------------------------------- */ +/* function (mode) */ +/* --------------------------------------------------------------------- */ + +function versions() +{ + return array('3.5', '3.4', '3.3', '3.2', '3.1', '3.0', + '2.3', '2.2', '2.1', '2.0'); +} + +/** + * Whether pgpool is operating in the replication mode or not? + */ +function isReplicationMode() +{ + $params = readConfigParams(array('replication_mode')); + + if (isTrue($params['replication_mode'])) { return TRUE; - } elseif ($del_version && _PGPOOL2_VERSION < $del_version) { + } else { + return FALSE; + } +} + +/** + * Whether pgpool is operating in the master slave mode or not? + */ +function isMasterSlaveMode() +{ + $params = readConfigParams(array('master_slave_mode')); + + if (isTrue($params['master_slave_mode'])) { return TRUE; + } else { + return FALSE; } - return FALSE; } -/* Get if loginUser is super user */ -function isSuperUser($user_name) +/** + * Whether pgpool is operating in the parallel mode or not? + */ +function isParallelMode() { - $conn = @pg_connect(conStrPgpool()); + $params = readConfigParams(array('parallel_mode')); - if ($conn == FALSE) { - @pg_close($conn); - return NULL; + if (isTrue($params['parallel_mode'])) { + return TRUE; + } else { + return FALSE; } +} - $result = pg_query($conn, "SELECT usesuper FROM pg_user WHERE usename = '{$user_name}'"); +/** + * Whether pgpool is using stream sub mode in master slave mode or not? + */ +function useStreaming() +{ + $params = readConfigParams(array('master_slave_sub_mode')); - if (!pg_result_status($result) == PGSQL_TUPLES_OK) { - @pg_close($conn); - return NULL; + if (isMasterSlaveMode() && $params['master_slave_sub_mode'] == 'stream') { + return TRUE; + } else { + return FALSE; } +} - $rr = pg_fetch_array($result); - $rtn = (isset($rr['usesuper']) && $rr['usesuper'] == 't') ? 'yes' : 'no'; +/** + * Whether pgpool uses syslog or not? + */ +function useSyslog() +{ + if (!paramExists('log_destination')) { return FALSE; } - @pg_free_result($result); - @pg_close($conn); + $params = readConfigParams(array('log_destination')); - $_SESSION[SESSION_IS_SUPER_USER] = $rtn; + if ($params['log_destination'] == 'syslog') { + return TRUE; + } else { + return FALSE; + } +} + +/** + * Return if pgpool has watchdog feature + */ +function hasWatchdog() +{ + return (3.2 <= _PGPOOL2_VERSION); +} + +/** + * Return if pgpool has memqcache + */ +function hasMemqcache() +{ + return (3.2 <= _PGPOOL2_VERSION); +} + +/** + * Return if pgpool has pcp_promote_node ? + */ +function hasPcpPromote() +{ + return (3.1 <= _PGPOOL2_VERSION); +} + +/* + * Return the list of parameters in a group + */ +function getMultiParams() +{ + $rtn = array(); + + $rtn['backend'] = array('backend_hostname', 'backend_port', 'backend_weight', 'backend_data_directory'); + if (paramExists('backend_flag')) { + $rtn['backend'][] = 'backend_flag'; + } + + $rtn['other_pgpool'] = array('other_pgpool_hostname', 'other_pgpool_port', 'other_wd_port'); + + $rtn['heartbeat'] = array('heartbeat_destination', 'heartbeat_destination_port', 'heartbeat_device'); return $rtn; } -function conStrPgpool() +/* --------------------------------------------------------------------- */ +/* function (other) */ +/* --------------------------------------------------------------------- */ + +function isPipe($str) + { - $params = readConfigParams(array('port')); - $conStr[] = "port='{$params['port']}'"; - $conStr[] = "dbname='template1'"; - $conStr[] = "user='{$_SESSION[SESSION_LOGIN_USER]}'"; - $conStr[] = "password='{$_SESSION[SESSION_LOGIN_USER_PASSWORD]}'"; + return (strpos($str, '|') !== FALSE); +} - $conStr = implode($conStr, ' '); - return $conStr; +function isTrue($value) +{ + return in_array($value, array('on', 'true')); +} + +function errorPage($errorCode) +{ + global $tpl; + + $tpl->assign('errorCode', $errorCode); + $tpl->display('error.tpl'); + exit(); } -/* for debug */ function pr($array) { echo '
';
diff --git a/config.php b/config.php
index 5e74406..bd8dfd7 100644
--- a/config.php
+++ b/config.php
@@ -19,7 +19,7 @@
  * is" without express or implied warranty.
  *
  * @author     Ryuma Ando 
- * @copyright  2003-2012 PgPool Global Development Group
+ * @copyright  2003-2015 PgPool Global Development Group
  * @version    CVS: $Id$
  */
 
@@ -52,6 +52,21 @@ $params = array();
 global $errors;
 $errors = array();
 
+/* --------------------------------------------------------------------- */
+/* define                                                                */
+/* --------------------------------------------------------------------- */
+
+$select_options = array(
+    'lang' => array('auto' => 'auto') + $messageList,
+    'version' => array_combine(versions(), versions()),
+    'm' => array('s' => 'smart', 'f' => 'fast', 'i' => 'immediate'),
+);
+$tpl->assign('select_options', $select_options);
+
+/* --------------------------------------------------------------------- */
+/* main                                                                  */
+/* --------------------------------------------------------------------- */
+
 /*
  * Read current parameter
  */
@@ -89,7 +104,6 @@ $params['pcp_refresh_time']   = (defined('_PGPOOL2_STATUS_REFRESH_TIME')) ?
 $tpl->assign('status', NULL);
 switch ( $action ) {
     case 'update':
-
         setValue('lang');
         setValue('version');
         setValue('pgpool_config_file');
@@ -108,13 +122,11 @@ switch ( $action ) {
         setBool('C');
 
         setValue('pgpool_logfile');
-        // pipe
         if ($params['pgpool_logfile'] != '' && isPipe($params['pgpool_logfile'])) {
             $tmp_str = trim($params['pgpool_logfile']);
             if ($tmp_str[0] != '|' || $tmp_str[strlen($tmp_str) - 1] == '|') {
                 $errors['pgpool_logfile'] = $message['errIllegalPipe'];
             }
-        // file
         } elseif ($params['pgpool_logfile'] != '' && !is_writable(dirname($params['pgpool_logfile']))) {
             $errors['pgpool_logfile'] = $message['errFileNotWritable'];
         }
@@ -141,20 +153,10 @@ switch ( $action ) {
         if (count($errors) == 0 ) {
             $pgmgtConfigFile = dirname(__FILE__) . '/conf/pgmgt.conf.php';
 
-            if (!is_writable($pgmgtConfigFile)) {
-                $errorCode = 'e5003';
-                $tpl->assign('errorCode', $errorCode);
-                $tpl->display('error.tpl');
-                exit();
-            }
+            if (! is_writable($pgmgtConfigFile)) { errorPage('e5003'); }
 
             $result = writePgmtConf($pgmgtConfigFile);
-            if (!$result) {
-                $errorCode = 'e5001';
-                $tpl->assign('errorCode', $errorCode);
-                $tpl->display('error.tpl');
-                exit();
-            }
+            if (!$result) { errorPage('e5001'); }
 
             $tpl->assign('status', 'success');
 
@@ -205,8 +207,17 @@ function setBool($key)
     global $g_post;
     global $params;
 
-    if (isset($g_post[$key])) {
-        $params[$key] = 1;
+    switch ($key) {
+    case 'C':
+        $key_in_form = 'large_c'; break;
+    case 'D':
+        $key_in_form = 'large_d'; break;
+    default:
+        $key_in_form = $key; break;
+    }
+
+    if (isset($g_post[$key_in_form])) {
+        $params[$key] = $g_post[$key_in_form];
     } else {
         $params[$key] = 0;
     }
diff --git a/definePgpoolConfParam.php b/definePgpoolConfParam.php
index 5cf1cfd..9710125 100644
--- a/definePgpoolConfParam.php
+++ b/definePgpoolConfParam.php
@@ -18,7 +18,7 @@
  * is" without express or implied warranty.
  *
  * @author     Ryuma Ando 
- * @copyright  2003-2013 PgPool Global Development Group
+ * @copyright  2003-2015 PgPool Global Development Group
  * @version    CVS: $Id$
  */
 
@@ -56,17 +56,20 @@ $key = 'listen_addresses';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = 'localhost';
 $pgpoolConfigParam[$key]['regexp'] = $addressreg;
+$pgpoolConfigParam[$key]['restart'] = TRUE;
 
 $key = 'port';
 $pgpoolConfigParam[$key]['type'] = 'N';
 $pgpoolConfigParam[$key]['default'] = 9999;
 $pgpoolConfigParam[$key]['max'] = NUM_MAX;
 $pgpoolConfigParam[$key]['min'] = 1024;
+$pgpoolConfigParam[$key]['restart'] = TRUE;
 
 $key = 'socket_dir';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = '/tmp';
 $pgpoolConfigParam[$key]['regexp'] = $dirreg;
+$pgpoolConfigParam[$key]['restart'] = TRUE;
 
 $key = 'listen_backlog_multiplier';
 $pgpoolConfigParam[$key]['type'] = 'N';
@@ -74,18 +77,30 @@ $pgpoolConfigParam[$key]['default'] = 2;
 $pgpoolConfigParam[$key]['max'] = NUM_MAX;
 $pgpoolConfigParam[$key]['min'] = 1;
 
+$key = 'serialize_accept';
+$pgpoolConfigParam[$key]['type'] = 'B';
+$pgpoolConfigParam[$key]['default'] = 'off';
+
 # - pgpool Communication Manager Connection Settings -
 
+$key = 'pcp_listen_addresses';
+$pgpoolConfigParam[$key]['type'] = 'C';
+$pgpoolConfigParam[$key]['default'] = 'localhost';
+$pgpoolConfigParam[$key]['regexp'] = $addressreg;
+$pgpoolConfigParam[$key]['restart'] = TRUE;
+
 $key = 'pcp_port';
 $pgpoolConfigParam[$key]['type'] = 'N';
 $pgpoolConfigParam[$key]['default'] = 9898;
 $pgpoolConfigParam[$key]['min'] = 1024;
 $pgpoolConfigParam[$key]['max'] = NUM_MAX;
+$pgpoolConfigParam[$key]['restart'] = TRUE;
 
 $key = 'pcp_socket_dir';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = '/tmp';
 $pgpoolConfigParam[$key]['regexp'] = $dirreg;
+$pgpoolConfigParam[$key]['restart'] = TRUE;
 
 # - Backend Connection Settings -
 
@@ -93,28 +108,34 @@ $key = 'backend_hostname';
 $pgpoolConfigBackendParam[$key]['type'] = 'C';
 $pgpoolConfigBackendParam[$key]['default'] = '';
 $pgpoolConfigBackendParam[$key]['regexp'] = $hostreg;
+$pgpoolConfigBackendParam[$key]['multiple'] = TRUE;
 
 $key = 'backend_port';
 $pgpoolConfigBackendParam[$key]['type'] = 'N';
 $pgpoolConfigBackendParam[$key]['default'] = 5432;
 $pgpoolConfigBackendParam[$key]['min'] = 1024;
 $pgpoolConfigBackendParam[$key]['max'] = NUM_MAX;
+$pgpoolConfigBackendParam[$key]['multiple'] = TRUE;
 
 $key = 'backend_weight';
 $pgpoolConfigBackendParam[$key]['type'] = 'F';
 $pgpoolConfigBackendParam[$key]['default'] = 1;
 $pgpoolConfigBackendParam[$key]['min'] = 0.0;
 $pgpoolConfigBackendParam[$key]['max'] = 100.0;
+$pgpoolConfigBackendParam[$key]['multiple'] = TRUE;
 
 $key = 'backend_data_directory';
 $pgpoolConfigBackendParam[$key]['type'] = 'C';
 $pgpoolConfigBackendParam[$key]['default'] = '';
 $pgpoolConfigBackendParam[$key]['regexp'] = $anyelse;
+$pgpoolConfigBackendParam[$key]['multiple'] = TRUE;
 
 $key = 'backend_flag';
 $pgpoolConfigBackendParam[$key]['type'] = 'C';
 $pgpoolConfigBackendParam[$key]['default'] = 'ALLOW_TO_FAILOVER';
-$pgpoolConfigBackendParam[$key]['regexp'] = selectreg(array('ALLOW_TO_FAILOVER', 'DISALLOW_TO_FAILOVER'));
+$pgpoolConfigBackendParam[$key]['select'] = array('ALLOW_TO_FAILOVER', 'DISALLOW_TO_FAILOVER');
+$pgpoolConfigBackendParam[$key]['regexp'] = selectreg($pgpoolConfigBackendParam[$key]['select']);
+$pgpoolConfigBackendParam[$key]['multiple'] = TRUE;
 
 # - Authentication -
 
@@ -138,26 +159,35 @@ $pgpoolConfigParam[$key]['max'] = 10000;
 $key = 'ssl';
 $pgpoolConfigParam[$key]['type'] = 'B';
 $pgpoolConfigParam[$key]['default'] = 'off';
+$pgpoolConfigParam[$key]['restart'] = TRUE;
 
 $key = 'ssl_key';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = '';
 $pgpoolConfigParam[$key]['regexp'] = $sslreg;
+$pgpoolConfigParam[$key]['restart'] = TRUE;
+$pgpoolConfigParam[$key]['parent'] = array('ssl' => 'on');
 
 $key = 'ssl_cert';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = '';
 $pgpoolConfigParam[$key]['regexp'] = $sslreg;
+$pgpoolConfigParam[$key]['restart'] = TRUE;
+$pgpoolConfigParam[$key]['parent'] = array('ssl' => 'on');
 
 $key = 'ssl_ca_cert';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = '';
 $pgpoolConfigParam[$key]['regexp'] = $sslreg;
+$pgpoolConfigParam[$key]['restart'] = TRUE;
+$pgpoolConfigParam[$key]['parent'] = array('ssl' => 'on');
 
 $key = 'ssl_ca_cert_dir';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = '';
 $pgpoolConfigParam[$key]['regexp'] = $sslreg;
+$pgpoolConfigParam[$key]['restart'] = TRUE;
+$pgpoolConfigParam[$key]['parent'] = array('ssl' => 'on');
 
 #------------------------------------------------------------------------------
 # POOLS
@@ -170,12 +200,14 @@ $pgpoolConfigParam[$key]['type'] = 'N';
 $pgpoolConfigParam[$key]['default'] = '32';
 $pgpoolConfigParam[$key]['min'] = 1;
 $pgpoolConfigParam[$key]['max'] = NUM_MAX;
+$pgpoolConfigParam[$key]['restart'] = TRUE;
 
 $key = 'max_pool';
 $pgpoolConfigParam[$key]['type'] = 'N';
 $pgpoolConfigParam[$key]['default'] = 4;
 $pgpoolConfigParam[$key]['min'] = 1;
 $pgpoolConfigParam[$key]['max'] = NUM_MAX;
+$pgpoolConfigParam[$key]['restart'] = TRUE;
 
 # - Life time -
 
@@ -212,7 +244,8 @@ $pgpoolConfigParam[$key]['max'] = NUM_MAX;
 $key = 'log_destination';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = 'stderr';
-$pgpoolConfigParam[$key]['regexp'] = selectreg(array('stderr', 'syslog'));
+$pgpoolConfigParam[$key]['select'] = array('stderr', 'syslog');
+$pgpoolConfigParam[$key]['regexp'] = selectreg($pgpoolConfigParam[$key]['select']);
 
 # - What to log -
 
@@ -224,6 +257,7 @@ $pgpoolConfigParam[$key]['regexp'] = $anyelse;
 $key = 'print_timestamp';
 $pgpoolConfigParam[$key]['type'] = 'B';
 $pgpoolConfigParam[$key]['default'] = 'on';
+$pgpoolConfigParam[$key]['restart'] = TRUE;
 
 $key = 'log_connections';
 $pgpoolConfigParam[$key]['type'] = 'B';
@@ -244,7 +278,8 @@ $pgpoolConfigParam[$key]['default'] = 'off';
 $key = 'log_standby_delay';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = 'none';
-$pgpoolConfigParam[$key]['regexp'] = selectreg(array('always', 'if_over_threshold', 'none'));
+$pgpoolConfigParam[$key]['select'] = array('always', 'if_over_threshold', 'none');
+$pgpoolConfigParam[$key]['regexp'] = selectreg($pgpoolConfigParam[$key]['select']);
 
 # - Syslog specific -
 
@@ -252,11 +287,13 @@ $key = 'syslog_facility';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = 'LOCAL0';
 $pgpoolConfigParam[$key]['regexp'] = $strreg;
+$pgpoolConfigParam[$key]['parent'] = array('log_destination' => 'syslog');
 
 $key = 'syslog_ident';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = 'pgpool';
 $pgpoolConfigParam[$key]['regexp'] = $strreg;
+$pgpoolConfigParam[$key]['parent'] = array('log_destination' => 'syslog');
 
 # - Debug -
 
@@ -269,19 +306,26 @@ $pgpoolConfigParam[$key]['max'] = NUM_MAX;
 $key = 'log_error_verbosity';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = 'DEFAULT';
-$pgpoolConfigParam[$key]['regexp'] = selectreg(array('TERSE', 'DEFAULT', 'VERBOSE'));
+$pgpoolConfigParam[$key]['select'] = array('TERSE', 'DEFAULT', 'VERBOSE');
+$pgpoolConfigParam[$key]['regexp'] = selectreg($pgpoolConfigParam[$key]['select']);
 
 $key = 'client_min_messages';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = 'notice';
-$pgpoolConfigParam[$key]['regexp'] = selectreg(array('debug5', 'debug4', 'debug3', 'debug2', 'debug1',
-                                                     'log', 'notice', 'warning', 'error'));
+$pgpoolConfigParam[$key]['select'] = array(
+    'debug5', 'debug4', 'debug3', 'debug2', 'debug1',
+    'log', 'notice', 'warning', 'error'
+);
+$pgpoolConfigParam[$key]['regexp'] = selectreg($pgpoolConfigParam[$key]['select']);
 
 $key = 'log_min_messages';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = 'warning';
-$pgpoolConfigParam[$key]['regexp'] = selectreg(array('debug5', 'debug4', 'debug3', 'debug2', 'debug1',
-                                                     'info', 'notice', 'warning', 'error', 'log', 'fatal', 'panic'));
+$pgpoolConfigParam[$key]['select'] = array(
+    'debug5', 'debug4', 'debug3', 'debug2', 'debug1',
+    'info', 'notice', 'warning', 'error', 'log', 'fatal', 'panic'
+);
+$pgpoolConfigParam[$key]['regexp'] = selectreg($pgpoolConfigParam[$key]['select']);
 
 #------------------------------------------------------------------------------
 # FILE LOCATIONS
@@ -291,11 +335,13 @@ $key = 'pid_file_name';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = '/var/run/pgpool/pgpool.pid';
 $pgpoolConfigParam[$key]['regexp'] = $dirreg;
+$pgpoolConfigParam[$key]['restart'] = TRUE;
 
 $key = 'logdir';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = '/tmp';
 $pgpoolConfigParam[$key]['regexp'] = $dirreg;
+$pgpoolConfigParam[$key]['restart'] = TRUE;
 
 #------------------------------------------------------------------------------
 # CONNECTION POOLING
@@ -304,6 +350,7 @@ $pgpoolConfigParam[$key]['regexp'] = $dirreg;
 $key = 'connection_cache';
 $pgpoolConfigParam[$key]['type'] = 'B';
 $pgpoolConfigParam[$key]['default'] =true;
+$pgpoolConfigParam[$key]['restart'] = TRUE;
 
 $key = 'reset_query_list';
 $pgpoolConfigParam[$key]['type'] = 'C';
@@ -317,29 +364,35 @@ $pgpoolConfigParam[$key]['regexp'] = $queryreg;
 $key = 'replication_mode';
 $pgpoolConfigParam[$key]['type'] = 'B';
 $pgpoolConfigParam[$key]['default'] = 'off';
+$pgpoolConfigParam[$key]['restart'] = TRUE;
 
 $key = 'replicate_select';
 $pgpoolConfigParam[$key]['type'] = 'B';
 $pgpoolConfigParam[$key]['default'] = 'off';
+$pgpoolConfigParam[$key]['parent'] = array('replication_mode' => 'on');
 
 $key = 'insert_lock';
 $pgpoolConfigParam[$key]['type'] = 'B';
 $pgpoolConfigParam[$key]['default'] = 'off';
+$pgpoolConfigParam[$key]['parent'] = array('replication_mode' => 'on');
 
 $key = 'lobj_lock_table';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = '';
 $pgpoolConfigParam[$key]['regexp'] = $anyelse;
+$pgpoolConfigParam[$key]['parent'] = array('replication_mode' => 'on');
 
 # - Degenerate handling -
 
 $key = 'replication_stop_on_mismatch';
 $pgpoolConfigParam[$key]['type'] = 'B';
 $pgpoolConfigParam[$key]['default'] = 'off';
+$pgpoolConfigParam[$key]['parent'] = array('replication_mode' => 'on');
 
 $key = 'failover_if_affected_tuples_mismatch';
 $pgpoolConfigParam[$key]['type'] = 'B';
 $pgpoolConfigParam[$key]['default'] = 'off';
+$pgpoolConfigParam[$key]['parent'] = array('replication_mode' => 'on');
 
 #------------------------------------------------------------------------------
 # LOAD BALANCING MODE
@@ -348,34 +401,41 @@ $pgpoolConfigParam[$key]['default'] = 'off';
 $key = 'load_balance_mode';
 $pgpoolConfigParam[$key]['type'] = 'B';
 $pgpoolConfigParam[$key]['default'] = 'off';
+$pgpoolConfigParam[$key]['restart'] = TRUE;
 
 $key = 'ignore_leading_white_space';
 $pgpoolConfigParam[$key]['type'] = 'B';
 $pgpoolConfigParam[$key]['default'] = true;
+$pgpoolConfigParam[$key]['parent'] = array('load_balance_mode' => 'on');
 
 $key = 'white_function_list';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = '';
 $pgpoolConfigParam[$key]['regexp'] = $anyelse;
+$pgpoolConfigParam[$key]['parent'] = array('load_balance_mode' => 'on');
 
 $key = 'black_function_list';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = '';
 $pgpoolConfigParam[$key]['regexp'] = $anyelse;
+$pgpoolConfigParam[$key]['parent'] = array('load_balance_mode' => 'on');
 
 $key = 'database_redirect_preference_list';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = '';
 $pgpoolConfigParam[$key]['regexp'] = $anyelse;
+$pgpoolConfigParam[$key]['parent'] = array('load_balance_mode' => 'on');
 
 $key = 'app_name_redirect_preference_list';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = '';
 $pgpoolConfigParam[$key]['regexp'] = $anyelse;
+$pgpoolConfigParam[$key]['parent'] = array('load_balance_mode' => 'on');
 
 $key = 'allow_sql_comments';
 $pgpoolConfigParam[$key]['type'] = 'B';
 $pgpoolConfigParam[$key]['default'] = 'off';
+$pgpoolConfigParam[$key]['parent'] = array('load_balance_mode' => 'on');
 
 #------------------------------------------------------------------------------
 # MASTER/SLAVE MODE
@@ -384,11 +444,15 @@ $pgpoolConfigParam[$key]['default'] = 'off';
 $key = 'master_slave_mode';
 $pgpoolConfigParam[$key]['type'] = 'B';
 $pgpoolConfigParam[$key]['default'] = 'off';
+$pgpoolConfigParam[$key]['restart'] = TRUE;
 
 $key = 'master_slave_sub_mode';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = 'slony';
-$pgpoolConfigParam[$key]['regexp'] = selectreg(array('slony', 'stream'));
+$pgpoolConfigParam[$key]['select'] = array('slony', 'stream');
+$pgpoolConfigParam[$key]['regexp'] = selectreg($pgpoolConfigParam[$key]['select']);
+$pgpoolConfigParam[$key]['restart'] = TRUE;
+$pgpoolConfigParam[$key]['parent'] = array('master_slave_mode' => 'on');
 
 # - Streaming -
 
@@ -397,28 +461,39 @@ $pgpoolConfigParam[$key]['type'] = 'N';
 $pgpoolConfigParam[$key]['default'] = 0;
 $pgpoolConfigParam[$key]['min'] = 0;
 $pgpoolConfigParam[$key]['max'] = NUM_MAX;
+$pgpoolConfigParam[$key]['parent'] = array('master_slave_mode' => 'on', 'master_slave_sub_mode' => 'stream');
 
 $key = 'sr_check_user';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = '';
 $pgpoolConfigParam[$key]['regexp'] = $listreg;
+$pgpoolConfigParam[$key]['parent'] = array('master_slave_mode' => 'on', 'master_slave_sub_mode' => 'stream');
 
 $key = 'sr_check_password';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = '';
 $pgpoolConfigParam[$key]['regexp'] = $listreg;
+$pgpoolConfigParam[$key]['parent'] = array('master_slave_mode' => 'on', 'master_slave_sub_mode' => 'stream');
+
+$key = 'sr_check_database';
+$pgpoolConfigParam[$key]['type'] = 'C';
+$pgpoolConfigParam[$key]['default'] = '';
+$pgpoolConfigParam[$key]['regexp'] = $listreg;
+$pgpoolConfigParam[$key]['parent'] = array('master_slave_mode' => 'on', 'master_slave_sub_mode' => 'stream');
 
 $key = 'delay_threshold';
 $pgpoolConfigParam[$key]['type'] = 'N';
 $pgpoolConfigParam[$key]['default'] = 0;
 $pgpoolConfigParam[$key]['min'] = 0;
 $pgpoolConfigParam[$key]['max'] = NUM_MAX;
+$pgpoolConfigParam[$key]['parent'] = array('master_slave_mode' => 'on', 'master_slave_sub_mode' => 'stream');
 
 # - Special commands -
 $key = 'follow_master_command';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = '';
 $pgpoolConfigParam[$key]['regexp'] = $anyelse;
+$pgpoolConfigParam[$key]['parent'] = array('master_slave_mode' => 'on');
 
 #------------------------------------------------------------------------------
 # PARALLEL MODE AND QUERY CACHE
@@ -427,15 +502,20 @@ $pgpoolConfigParam[$key]['regexp'] = $anyelse;
 $key = 'parallel_mode';
 $pgpoolConfigParam[$key]['type'] = 'B';
 $pgpoolConfigParam[$key]['default'] = 'off';
+$pgpoolConfigParam[$key]['restart'] = TRUE;
 
 $key = 'enable_query_cache';
 $pgpoolConfigParam[$key]['type'] = 'B';
 $pgpoolConfigParam[$key]['default'] = 'off';
+$pgpoolConfigParam[$key]['restart'] = TRUE;
+$pgpoolConfigParam[$key]['parent'] = array('parallel_mode' => 'on');
 
 $key = 'pgpool2_hostname';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = 'localhost';
 $pgpoolConfigParam[$key]['regexp'] = $hostreg;
+$pgpoolConfigParam[$key]['restart'] = TRUE;
+$pgpoolConfigParam[$key]['parent'] = array('parallel_mode' => 'on');
 
 # - System DB info -
 
@@ -443,32 +523,44 @@ $key = 'system_db_hostname';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = 'system_db_hostname';
 $pgpoolConfigParam[$key]['regexp'] = $hostreg;
+$pgpoolConfigParam[$key]['restart'] = TRUE;
+$pgpoolConfigParam[$key]['parent'] = array('parallel_mode' => 'on');
 
 $key = 'system_db_port';
 $pgpoolConfigParam[$key]['type'] = 'N';
 $pgpoolConfigParam[$key]['default'] = 5432;
 $pgpoolConfigParam[$key]['min'] = 1024;
 $pgpoolConfigParam[$key]['max'] = NUM_MAX;
+$pgpoolConfigParam[$key]['restart'] = TRUE;
+$pgpoolConfigParam[$key]['parent'] = array('parallel_mode' => 'on');
 
 $key = 'system_db_dbname';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = 'pgpool';
 $pgpoolConfigParam[$key]['regexp'] = $strreg;
+$pgpoolConfigParam[$key]['restart'] = TRUE;
+$pgpoolConfigParam[$key]['parent'] = array('parallel_mode' => 'on');
 
 $key = 'system_db_schema';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = 'pgpool_catalog';
 $pgpoolConfigParam[$key]['regexp'] = $strreg;
+$pgpoolConfigParam[$key]['restart'] = TRUE;
+$pgpoolConfigParam[$key]['parent'] = array('parallel_mode' => 'on');
 
 $key = 'system_db_user';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = 'pgpool';
 $pgpoolConfigParam[$key]['regexp'] = $userreg;
+$pgpoolConfigParam[$key]['restart'] = TRUE;
+$pgpoolConfigParam[$key]['parent'] = array('parallel_mode' => 'on');
 
 $key = 'system_db_password';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = '';
 $pgpoolConfigParam[$key]['regexp'] = $anyelse;
+$pgpoolConfigParam[$key]['restart'] = TRUE;
+$pgpoolConfigParam[$key]['parent'] = array('parallel_mode' => 'on');
 
 #------------------------------------------------------------------------------
 # HEALTH CHECK
@@ -496,6 +588,11 @@ $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = '';
 $pgpoolConfigParam[$key]['regexp'] = $anyelse;
 
+$key = 'health_check_database';
+$pgpoolConfigParam[$key]['type'] = 'C';
+$pgpoolConfigParam[$key]['default'] = '';
+$pgpoolConfigParam[$key]['regexp'] = $anyelse;
+
 $key = 'health_check_max_retries';
 $pgpoolConfigParam[$key]['type'] = 'N';
 $pgpoolConfigParam[$key]['default'] = 0;
@@ -532,6 +629,11 @@ $key = 'fail_over_on_backend_error';
 $pgpoolConfigParam[$key]['type'] = 'B';
 $pgpoolConfigParam[$key]['default'] = 'on';
 
+$key = 'search_primary_node_timeout';
+$pgpoolConfigParam[$key]['type'] = 'N';
+$pgpoolConfigParam[$key]['default'] = 10;
+$pgpoolConfigParam[$key]['min'] = 0;
+
 #------------------------------------------------------------------------------
 # ONLINE RECOVERY
 #------------------------------------------------------------------------------
@@ -585,18 +687,35 @@ $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = '';
 $pgpoolConfigParam[$key]['regexp'] = $hostreg;
 $pgpoolConfigParam[$key]['null_ok'] = TRUE;
+$pgpoolConfigParam[$key]['parent'] = array('use_watchdog' => 'on');
 
 $key = 'wd_port';
 $pgpoolConfigParam[$key]['type'] = 'N';
 $pgpoolConfigParam[$key]['default'] = 9000;
 $pgpoolConfigParam[$key]['max'] = NUM_MAX;
 $pgpoolConfigParam[$key]['min'] = 1024;
+$pgpoolConfigParam[$key]['parent'] = array('use_watchdog' => 'on');
+
+$key = 'wd_priority';
+$pgpoolConfigParam[$key]['type'] = 'N';
+$pgpoolConfigParam[$key]['default'] = 1;
+$pgpoolConfigParam[$key]['min'] = 0;
+$pgpoolConfigParam[$key]['max'] = NUM_MAX;
+$pgpoolConfigParam[$key]['parent'] = array('use_watchdog' => 'on');
 
 $key = 'wd_authkey';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = '';
 $pgpoolConfigParam[$key]['regexp'] = $anyelse;
 $pgpoolConfigParam[$key]['null_ok'] = TRUE;
+$pgpoolConfigParam[$key]['parent'] = array('use_watchdog' => 'on');
+
+$key = 'wd_ipc_socket_dir';
+$pgpoolConfigParam[$key]['type'] = 'C';
+$pgpoolConfigParam[$key]['default'] = '/tmp';
+$pgpoolConfigParam[$key]['regexp'] = $anyelse;
+$pgpoolConfigParam[$key]['null_ok'] = TRUE;
+$pgpoolConfigParam[$key]['parent'] = array('use_watchdog' => 'on');
 
 # Connection to up stream servers
 
@@ -604,11 +723,13 @@ $key = 'trusted_servers';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = '';
 $pgpoolConfigParam[$key]['regexp'] = $anyelse;
+$pgpoolConfigParam[$key]['parent'] = array('use_watchdog' => 'on');
 
 $key = 'ping_path';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = '';
 $pgpoolConfigParam[$key]['regexp'] = $anyelse;
+$pgpoolConfigParam[$key]['parent'] = array('use_watchdog' => 'on');
 
 # Virtual IP control
 
@@ -617,42 +738,62 @@ $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = '';
 $pgpoolConfigParam[$key]['regexp'] = $hostreg;
 $pgpoolConfigParam[$key]['null_ok'] = TRUE;
+$pgpoolConfigParam[$key]['parent'] = array('use_watchdog' => 'on');
 
 $key = 'ifconfig_path';
 $pgpoolConfigParam[$key]['type'] = 'C';
-$pgpoolConfigParam[$key]['default'] = '';
+$pgpoolConfigParam[$key]['default'] = '/sbin';
+$pgpoolConfigParam[$key]['regexp'] = $anyelse;
+$pgpoolConfigParam[$key]['parent'] = array('use_watchdog' => 'on');
+
+$key = 'if_cmd_path';
+$pgpoolConfigParam[$key]['type'] = 'C';
+$pgpoolConfigParam[$key]['default'] = '/sbin';
 $pgpoolConfigParam[$key]['regexp'] = $anyelse;
+$pgpoolConfigParam[$key]['parent'] = array('use_watchdog' => 'on');
 
 $key = 'if_up_cmd';
 $pgpoolConfigParam[$key]['type'] = 'C';
-$pgpoolConfigParam[$key]['default'] = '';
+$pgpoolConfigParam[$key]['default'] = 'ip addr add $_IP_$/24 dev eth0 label eth0:0';
 $pgpoolConfigParam[$key]['regexp'] = $anyelse;
+$pgpoolConfigParam[$key]['parent'] = array('use_watchdog' => 'on');
 
 $key = 'if_down_cmd';
 $pgpoolConfigParam[$key]['type'] = 'C';
-$pgpoolConfigParam[$key]['default'] = '';
+$pgpoolConfigParam[$key]['default'] = 'ip addr del $_IP_$/24 dev eth0';
 $pgpoolConfigParam[$key]['regexp'] = $anyelse;
+$pgpoolConfigParam[$key]['parent'] = array('use_watchdog' => 'on');
 
 $key = 'arping_path';
 $pgpoolConfigParam[$key]['type'] = 'C';
-$pgpoolConfigParam[$key]['default'] = '';
+$pgpoolConfigParam[$key]['default'] = '/usr/sbin';
 $pgpoolConfigParam[$key]['regexp'] = $anyelse;
+$pgpoolConfigParam[$key]['parent'] = array('use_watchdog' => 'on');
 
 $key = 'arping_cmd';
 $pgpoolConfigParam[$key]['type'] = 'C';
-$pgpoolConfigParam[$key]['default'] = '';
+$pgpoolConfigParam[$key]['default'] = 'arping -U $_IP_$ -w 1';
 $pgpoolConfigParam[$key]['regexp'] = $anyelse;
+$pgpoolConfigParam[$key]['parent'] = array('use_watchdog' => 'on');
 
 # Behavior on escalation
 
 $key = 'clear_memqcache_on_escalation';
 $pgpoolConfigParam[$key]['type'] = 'B';
 $pgpoolConfigParam[$key]['default'] = 'on';
+$pgpoolConfigParam[$key]['parent'] = array('use_watchdog' => 'on');
 
 $key = 'wd_escalation_command';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = '';
 $pgpoolConfigParam[$key]['regexp'] = $anyelse;
+$pgpoolConfigParam[$key]['parent'] = array('use_watchdog' => 'on');
+
+$key = 'wd_de_escalation_command';
+$pgpoolConfigParam[$key]['type'] = 'C';
+$pgpoolConfigParam[$key]['default'] = '';
+$pgpoolConfigParam[$key]['regexp'] = $anyelse;
+$pgpoolConfigParam[$key]['parent'] = array('use_watchdog' => 'on');
 
 # Life checking pgpool-II
 
@@ -661,13 +802,16 @@ $pgpoolConfigParam[$key]['regexp'] = $anyelse;
 $key = 'wd_lifecheck_method';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = 'heartbeat';
-$pgpoolConfigParam[$key]['regexp'] = selectreg(array('heartbeat', 'query'));
+$pgpoolConfigParam[$key]['select'] = array('heartbeat', 'query');
+$pgpoolConfigParam[$key]['regexp'] = selectreg($pgpoolConfigParam[$key]['select']);
+$pgpoolConfigParam[$key]['parent'] = array('use_watchdog' => 'on');
 
 $key = 'wd_interval';
 $pgpoolConfigParam[$key]['type'] = 'N';
 $pgpoolConfigParam[$key]['default'] = 10;
 $pgpoolConfigParam[$key]['max'] = NUM_MAX;
 $pgpoolConfigParam[$key]['min'] = 0;
+$pgpoolConfigParam[$key]['parent'] = array('use_watchdog' => 'on');
 
 # (Configuration of heartbeat mode)
 
@@ -676,34 +820,43 @@ $pgpoolConfigParam[$key]['type'] = 'N';
 $pgpoolConfigParam[$key]['default'] = 9694;
 $pgpoolConfigParam[$key]['max'] = NUM_MAX;
 $pgpoolConfigParam[$key]['min'] = 0;
+$pgpoolConfigParam[$key]['parent'] = array('use_watchdog' => 'on', 'wd_lifecheck_method' => 'heartbeat');
 
 $key = 'wd_heartbeat_keepalive';
 $pgpoolConfigParam[$key]['type'] = 'N';
 $pgpoolConfigParam[$key]['default'] = 2;
 $pgpoolConfigParam[$key]['max'] = NUM_MAX;
 $pgpoolConfigParam[$key]['min'] = 0;
+$pgpoolConfigParam[$key]['parent'] = array('use_watchdog' => 'on', 'wd_lifecheck_method' => 'heartbeat');
 
 $key = 'wd_heartbeat_deadtime';
 $pgpoolConfigParam[$key]['type'] = 'N';
 $pgpoolConfigParam[$key]['default'] = 30;
 $pgpoolConfigParam[$key]['max'] = NUM_MAX;
 $pgpoolConfigParam[$key]['min'] = 0;
+$pgpoolConfigParam[$key]['parent'] = array('use_watchdog' => 'on', 'wd_lifecheck_method' => 'heartbeat');
 
 $key = 'heartbeat_destination';
 $pgpoolConfigHbDestinationParam[$key]['type'] = 'C';
 $pgpoolConfigHbDestinationParam[$key]['default'] = '';
 $pgpoolConfigHbDestinationParam[$key]['regexp'] = $hostreg;
+$pgpoolConfigHbDestinationParam[$key]['multiple'] = TRUE;
+$pgpoolConfigParam[$key]['parent'] = array('use_watchdog' => 'on', 'wd_lifecheck_method' => 'heartbeat');
 
 $key = 'heartbeat_destination_port';
 $pgpoolConfigHbDestinationParam[$key]['type'] = 'N';
 $pgpoolConfigHbDestinationParam[$key]['default'] = 9694;
 $pgpoolConfigHbDestinationParam[$key]['min'] = 1024;
 $pgpoolConfigHbDestinationParam[$key]['max'] = NUM_MAX;
+$pgpoolConfigHbDestinationParam[$key]['multiple'] = TRUE;
+$pgpoolConfigParam[$key]['parent'] = array('use_watchdog' => 'on', 'wd_lifecheck_method' => 'heartbeat');
 
 $key = 'heartbeat_device';
 $pgpoolConfigHbDestinationParam[$key]['type'] = 'C';
 $pgpoolConfigHbDestinationParam[$key]['default'] = 'eth0';
 $pgpoolConfigHbDestinationParam[$key]['regexp'] = $anyelse;
+$pgpoolConfigHbDestinationParam[$key]['multiple'] = TRUE;
+$pgpoolConfigParam[$key]['parent'] = array('use_watchdog' => 'on', 'wd_lifecheck_method' => 'heartbeat');
 
 # (Configuration of query mode)
 
@@ -712,26 +865,31 @@ $pgpoolConfigParam[$key]['type'] = 'N';
 $pgpoolConfigParam[$key]['default'] = 3;
 $pgpoolConfigParam[$key]['max'] = NUM_MAX;
 $pgpoolConfigParam[$key]['min'] = 0;
+$pgpoolConfigParam[$key]['parent'] = array('use_watchdog' => 'on', 'wd_lifecheck_method' => 'query');
 
 $key = 'wd_lifecheck_query';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = 'SELECT 1';
 $pgpoolConfigParam[$key]['regexp'] = $anyelse;
+$pgpoolConfigParam[$key]['parent'] = array('use_watchdog' => 'on', 'wd_lifecheck_method' => 'query');
 
 $key = 'wd_lifecheck_dbname';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = 'template1';
 $pgpoolConfigParam[$key]['regexp'] = $anyelse;
+$pgpoolConfigParam[$key]['parent'] = array('use_watchdog' => 'on', 'wd_lifecheck_method' => 'query');
 
 $key = 'wd_lifecheck_user';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = 'nobody';
 $pgpoolConfigParam[$key]['regexp'] = $anyelse;
+$pgpoolConfigParam[$key]['parent'] = array('use_watchdog' => 'on', 'wd_lifecheck_method' => 'query');
 
 $key = 'wd_lifecheck_password';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = '';
 $pgpoolConfigParam[$key]['regexp'] = $anyelse;
+$pgpoolConfigParam[$key]['parent'] = array('use_watchdog' => 'on', 'wd_lifecheck_method' => 'query');
 
 # Servers to monitor
 
@@ -739,18 +897,24 @@ $key = 'other_pgpool_hostname';
 $pgpoolConfigWdOtherParam[$key]['type'] = 'C';
 $pgpoolConfigWdOtherParam[$key]['default'] = '';
 $pgpoolConfigWdOtherParam[$key]['regexp'] = $hostreg;
+$pgpoolConfigWdOtherParam[$key]['multiple'] = TRUE;
+$pgpoolConfigParam[$key]['parent'] = array('use_watchdog' => 'on');
 
 $key = 'other_pgpool_port';
 $pgpoolConfigWdOtherParam[$key]['type'] = 'N';
 $pgpoolConfigWdOtherParam[$key]['default'] = 9999;
 $pgpoolConfigWdOtherParam[$key]['min'] = 1024;
 $pgpoolConfigWdOtherParam[$key]['max'] = NUM_MAX;
+$pgpoolConfigWdOtherParam[$key]['multiple'] = TRUE;
+$pgpoolConfigParam[$key]['parent'] = array('use_watchdog' => 'on');
 
 $key = 'other_wd_port';
 $pgpoolConfigWdOtherParam[$key]['type'] = 'N';
 $pgpoolConfigWdOtherParam[$key]['default'] = 9000;
 $pgpoolConfigWdOtherParam[$key]['min'] = 1024;
 $pgpoolConfigWdOtherParam[$key]['max'] = NUM_MAX;
+$pgpoolConfigWdOtherParam[$key]['multiple'] = TRUE;
+$pgpoolConfigParam[$key]['parent'] = array('use_watchdog' => 'on');
 
 #------------------------------------------------------------------------------
 # IN MEMORY QUERY CACHE
@@ -763,67 +927,80 @@ $pgpoolConfigParam[$key]['default'] = 'off';
 $key = 'memqcache_method';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = 'shmem';
-$pgpoolConfigParam[$key]['regexp'] = selectreg(array('shmem', 'memcached'));
+$pgpoolConfigParam[$key]['select'] = array('shmem', 'memcached');
+$pgpoolConfigParam[$key]['regexp'] = selectreg($pgpoolConfigParam[$key]['select']);
+$pgpoolConfigParam[$key]['parent'] = array('memory_cache_enabled' => 'on');
 
 $key = 'memqcache_memcached_host';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = 'localhost';
 $pgpoolConfigParam[$key]['regexp'] = $hostreg;
+$pgpoolConfigParam[$key]['parent'] = array('memory_cache_enabled' => 'on');
 
 $key = 'memqcache_memcached_port';
 $pgpoolConfigParam[$key]['type'] = 'N';
 $pgpoolConfigParam[$key]['default'] = 11211;
 $pgpoolConfigParam[$key]['max'] = NUM_MAX;
 $pgpoolConfigParam[$key]['min'] = 1024;
+$pgpoolConfigParam[$key]['parent'] = array('memory_cache_enabled' => 'on');
 
 $key = 'memqcache_total_size';
 $pgpoolConfigParam[$key]['type'] = 'N';
 $pgpoolConfigParam[$key]['default'] = 67108864;
 $pgpoolConfigParam[$key]['max'] = PHP_INT_MAX;
 $pgpoolConfigParam[$key]['min'] = 0;
+$pgpoolConfigParam[$key]['parent'] = array('memory_cache_enabled' => 'on');
 
 $key = 'memqcache_max_num_cache';
 $pgpoolConfigParam[$key]['type'] = 'N';
 $pgpoolConfigParam[$key]['default'] = 1000000;
 $pgpoolConfigParam[$key]['max'] = PHP_INT_MAX;
 $pgpoolConfigParam[$key]['min'] = 0;
+$pgpoolConfigParam[$key]['parent'] = array('memory_cache_enabled' => 'on');
 
 $key = 'memqcache_expire';
 $pgpoolConfigParam[$key]['type'] = 'N';
 $pgpoolConfigParam[$key]['default'] = 0;
 $pgpoolConfigParam[$key]['max'] = NUM_MAX;
 $pgpoolConfigParam[$key]['min'] = 0;
+$pgpoolConfigParam[$key]['parent'] = array('memory_cache_enabled' => 'on');
 
 $key = 'memqcache_auto_cache_invalidation';
 $pgpoolConfigParam[$key]['type'] = 'B';
 $pgpoolConfigParam[$key]['default'] = 'on';
+$pgpoolConfigParam[$key]['parent'] = array('memory_cache_enabled' => 'on');
 
 $key = 'memqcache_maxcache';
 $pgpoolConfigParam[$key]['type'] = 'N';
 $pgpoolConfigParam[$key]['default'] = 409600;
 $pgpoolConfigParam[$key]['max'] = PHP_INT_MAX;
 $pgpoolConfigParam[$key]['min'] = 0;
+$pgpoolConfigParam[$key]['parent'] = array('memory_cache_enabled' => 'on');
 
 $key = 'memqcache_cache_block_size';
 $pgpoolConfigParam[$key]['type'] = 'N';
 $pgpoolConfigParam[$key]['default'] = 1048576;
 $pgpoolConfigParam[$key]['max'] = PHP_INT_MAX;
 $pgpoolConfigParam[$key]['min'] = 512;
+$pgpoolConfigParam[$key]['parent'] = array('memory_cache_enabled' => 'on');
 
 $key = 'memqcache_oiddir';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = '/var/log/pgpool/oiddir';
 $pgpoolConfigParam[$key]['regexp'] = $dirreg;
+$pgpoolConfigParam[$key]['parent'] = array('memory_cache_enabled' => 'on');
 
 $key = 'white_memqcache_table_list';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = '';
 $pgpoolConfigParam[$key]['regexp'] = $anyelse;
+$pgpoolConfigParam[$key]['parent'] = array('memory_cache_enabled' => 'on');
 
 $key = 'black_memqcache_table_list';
 $pgpoolConfigParam[$key]['type'] = 'C';
 $pgpoolConfigParam[$key]['default'] = '';
 $pgpoolConfigParam[$key]['regexp'] = $anyelse;
+$pgpoolConfigParam[$key]['parent'] = array('memory_cache_enabled' => 'on');
 
 #------------------------------------------------------------------------------
 # OTHERS
diff --git a/innerSystemCatalog.php b/innerSystemCatalog.php
index f1b3f72..75309ea 100644
--- a/innerSystemCatalog.php
+++ b/innerSystemCatalog.php
@@ -19,7 +19,7 @@
  * is" without express or implied warranty.
  *
  * @author     Ryuma Ando 
- * @copyright  2003-2013 PgPool Global Development Group
+ * @copyright  2003-2015 PgPool Global Development Group
  * @version    CVS: $Id$
  */
 
@@ -42,25 +42,30 @@ if ($pgCatalog == '') {
     return;
 }
 
-// Set Parameters
-$params = readConfigParams(array('backend_hostname', 'backend_port'));
-
 // Get Data From Database
-$conn = @pg_connect(conStr($nodeNum));
-$sql = 'SHOW pool_status';
-
-$rs = execQuery($conn, $sql);
-
-if (!pg_result_status($rs) == PGSQL_TUPLES_OK) {
-    $sql = "SELECT * FROM $pgCatalog";
-    $rs = execQuery($conn, $sql);
+$params = readConfigParams(array(
+    'backend_hostname', 'backend_port', 'backend_weight',
+    'health_check_user', 'health_check_password'
+));
+$conn = openDBConnection(array(
+    'host'     => $params['backend_hostname'][$nodeNum],
+    'port'     => $params['backend_port'][$nodeNum],
+    'dbname'   => 'template1',
+    'user'     => $params['health_check_user'],
+    'password' => $params['health_check_password'],
+));
+
+$rs = execQuery($conn, 'SHOW pool_status');
+
+if (! pg_result_status($rs) == PGSQL_TUPLES_OK) {
+    $rs = execQuery($conn, "SELECT * FROM $pgCatalog");
     $tpl->assign('catalog', $pgCatalog);
 
 } else {
     $tpl->assign('catalog', 'pool_status');
 }
 
-if (!pg_result_status($rs) == PGSQL_TUPLES_OK) {
+if (! pg_result_status($rs) == PGSQL_TUPLES_OK) {
     $errorCode = 'e8001';
     $tpl->assign('errorCode', $errorCode);
     $tpl->display('innerError.tpl');
diff --git a/lang/en.lang.php b/lang/en.lang.php
index 12a140f..f78f4d5 100644
--- a/lang/en.lang.php
+++ b/lang/en.lang.php
@@ -19,7 +19,7 @@
  * is" without express or implied warranty.
  *
  * @author     Ryuma Ando 
- * @copyright  2003-2013 PgPool Global Development Group
+ * @copyright  2003-2015 PgPool Global Development Group
  * @version    CVS: $Id$
  */
 
@@ -42,6 +42,7 @@ $message = array(
     'descBlack_function_list' => 'Comma separated functions which write to database',
     'descBlack_memqcache_table_list' => 'Comma separated list of table names not to be cached',
     'descCheck_temp_table' => 'If on, enable temporary table check in SELECT statements',
+    'descCheck_unlogged_table' => 'If on, enable unlogged table check in SELECT statements.',
     'descChild_life_time' => 'Life of an idle child process in seconds',
     'descChild_max_connections' => 'If child_max_connections connections were received, child exits',
     'descClear_memqcache_on_escalation' => 'If on, watchdog clears all the query cache in the shared memory when pgpool-II escaltes to active',
@@ -51,7 +52,7 @@ $message = array(
     'descClient_min_messages' => 'Which minimum message levels are sent to the client',
     'descConnection_cache' => 'If true, cache connections to PostgreSQL',
     'descConnection_life_time' => 'Life time for each idle connection in seconds',
-    'desCconnect_timeout' => 'Timeout value in milliseconds before giving up connecting to backend using connect() system call',
+    'descConnect_timeout' => 'Timeout value in milliseconds before giving up connecting to backend using connect() system call',
     'descDatabase_redirect_preference_list' => '"database name:node id" pairs to specify the node id when connecting to the database',
     'descDelay_threshold' => 'If the standby server delays more than delay_threshold, '.
                              'any query goes to the primary only',
@@ -67,6 +68,7 @@ $message = array(
     'descHeartbeat_destination' => 'The destination of heartbeat signals. Specify by hostname or IP address.',
     'descHeartbeat_destination_port' => 'The port number of the destination of heartbeat signals.',
     'descHeartbeat_device' => 'The network device name for sending heartbeat signals',
+    'descHealth_check_database' => 'The database name to perform health check',
     'descHealth_check_period' => 'Specifies the interval for next health checking. 0 means no health checking, '.
                                  '-1 means no wait',
     'descHealth_check_timeout' => 'Pgpool does "health check" periodically to detect PostgreSQL servers down, '.
@@ -123,6 +125,7 @@ $message = array(
     'descPcp_port' => 'The port number where pcp is running on',
     'descPcp_socket_dir' => 'The socket directory pcp could connect',
     'descPcp_timeout' => 'When there is no response in this time from client, it disconnects and stop',
+    'descPcp_listen_addresses' => 'the hostname or IP address, on which pcp process will accept TCP/IP connections.',
     'descPgpool2_hostname' => 'Pgpool2 server name where running on',
     'descPool_passwd' => 'File name of pool_passwd for md5 authentication',
     'descPort' => 'The port number where pgpool is running on',
@@ -139,13 +142,18 @@ $message = array(
     'descReplicate_select' => 'If true, replicate SELECT queries. If false, send only to master',
     'descReplication_timeout' => 'In non strict replication mode, there will be a risk of deadlock. '.
                                  'Timeout in second for monitoring the deadlock',
+    'descSearch_primary_node_timeout' => 'the maximum amount of time in seconds to search'.
+                                         'for a primary node when a failover scenario occurs.',
+    'descSerialize_accept' => 'Whether to serialize accept() call for incoming client connections.',
     'descReset_query_list' => 'Semicolon separated SQL commands to be issued at the end of session',
+    'descSerialize_accept' => 'Whether to serialize accept() call for incoming client connections',
     'descSsl' => 'The frontend connection',
     'descSsl_ca_cert' => 'Path to the SSL private key file',
     'descSsl_ca_cert_dir' => 'Path to the SSL public certificate file',
     'descSsl_cert' => 'Path to the SSL private key file',
     'descSsl_key' => 'Path to the SSL private key file',
     'descSocket_dir' => 'The socket directory pgpool could connect',
+    'descSr_check_database' => 'The database to perform streaming replication delay check',
     'descSr_check_period' => 'Interval between the streaming replication delay checks in seconds.',
     'descSr_check_user' => 'User name to perform streaming replication check',
     'descSr_check_password' => 'Password of the user to perform streaming replication check',
@@ -160,12 +168,19 @@ $message = array(
     'descTrusted_servers' => 'The list of trusted servers to check the up stream connections',
     'descUse_watchdog' => 'Enable watchdog',
     'descWd_authkey' => 'The authentication key used in watchdog communication',
-    'descWd_escalation_command' => 'The command which will be executed on the new active when pgpool-II escaltes to active',
-    'descWd_heartbeat_deadtime' => 'If there are no heartbeat signal for the period specified by this option, watchdog regards it as failure of the remote pgpool-II.',
+    'descWd_de_escalation_command' => 'Watchdog executes this command on the master pgpool-II watchdog node '.
+                                      'when that node resigns from the master node responsibilities.',
+    'descWd_escalation_command' => 'The command which will be executed on the new active '.
+                                   'when pgpool-II escaltes to active',
+    'descWd_heartbeat_deadtime' => 'If there are no heartbeat signal for the period '.
+                                   'specified by this option, watchdog regards it '.
+                                   'as failure of the remote pgpool-II.',
     'descWd_heartbeat_keepalive' => 'The interval time of sending heartbeat signals in seconds',
     'descWd_heartbeat_port' => 'The port number to receive heartbeat signals',
     'descWd_hostname' => 'The hostname or IP address in which pgpool-II works',
     'descWd_interval' => 'The interval between life checks of pgpool-II in second',
+    'descWd_ipc_socket_dir' => 'The directory where the UNIX domain socket '.
+                               'accepting pgpool-II watchdog IPC connections will be created.',
     'descWd_life_point' => 'The times to retry a failed life check of pgpool-II',
     'descWd_lifecheck_dbname' => 'The database name connected for checking pgpool-II',
     'descWd_lifecheck_method' => 'The method of life check',
@@ -173,6 +188,8 @@ $message = array(
     'descWd_lifecheck_password' => 'The user name to check pgpool-II',
     'descWd_lifecheck_user' => 'The password of the user to check pgpool-II',
     'descWd_port' => 'The port number on which pgpool-II works',
+    'descWd_priority' => 'Elevate the local watchdog node priority in the elections '.
+                         'to select master watchdog node',
     'descWhite_function_list' => 'Comma separated functions those do not write to Database',
     'descWhite_memqcache_table_list' => 'Comma separated list of table names to be cached',
 
diff --git a/lang/ja.lang.php b/lang/ja.lang.php
index f7f7713..409aa83 100644
--- a/lang/ja.lang.php
+++ b/lang/ja.lang.php
@@ -41,6 +41,7 @@ $message = array(
     'descBlack_function_list' => 'データベースに書き込みを行なうカンマ区切りの関数のリスト',
     'descBlack_memqcache_table_list' => 'SELECT結果をキャッシュしたくないテーブル名のカンマ区切りのリスト',
     'descCheck_temp_table' => '一時テーブルかどうかをチェック',
+    'descCheck_unlogged_table' => 'unloggedテーブルかどうかをチェック',
     'descChild_life_time' => 'pgpoolの子プロセスの寿命',
     'descChild_max_connections' => '各pgpool子プロセスが終了するまでの接続回数',
     'descClear_memqcache_on_escalation' => 'アクティブ昇格時に共有メモリ上のクエリキャッシュを削除するかどうか',
@@ -49,7 +50,7 @@ $message = array(
     'descClient_min_messages' => 'クライアントに送るログの詳細レベル',
     'descConnection_cache' => 'コネクションキャッシュ機能の有無',
     'descConnection_life_time' => 'コネクションプール中のコネクションの有効期間(秒)',
-    'desCconnect_timeout' => 'connect()システムコールを使ってバックエンドに接続する際のタイムアウト値を指定(ミリ秒)',
+    'descConnect_timeout' => 'connect()システムコールを使ってバックエンドに接続する際のタイムアウト値を指定(ミリ秒)',
     'descDatabase_redirect_preference_list' => 'データベース名によって負荷分散をしたいノード番号を、"データベース名:ノード番号"で指定',
     'descDebug_level' => 'デバッグメッセージの詳細レベル(0は無効)',
     'descDelay_threshold' => '許容するスタンバイサーバの遅延(バイト)',
@@ -64,13 +65,15 @@ $message = array(
     'descHeartbeat_destination' => 'ハートビート信号の送信先ホスト名または IP アドレス',
     'descHeartbeat_destination_port' => 'ハートビート信号の送信先ポート番号',
     'descHeartbeat_device' => 'ハートビートの送受信に用いるネットワークデバイス名',
-    'descHealth_check_period' => 'ヘルスチェックを行う間隔(秒)',
+    'descHealth_check_database' => 'ヘルスチェックを行う対象のデータベース名',
+    'descHealth_check_period' => 'ヘルスチェックを行なう間隔(秒)',
     'descHealth_check_timeout' => 'ヘルスチェックが長時間待たされるのを防ぐためのタイムアウト値(秒)',
     'descHealth_check_user' => 'ヘルスチェックを行うためのPostgreSQLユーザ名',
     'descHealth_check_password' => 'ヘルスチェックを行うためのPostgreSQLパスワード',
     'descHealth_check_max_retries' => 'ヘルスチェックに失敗した後にリトライする回数',
     'descHealth_check_retry_delay' => 'ヘルスチェックのリトライの間の間隔(秒)',
     'descIfconfig_path' => 'ifconfig コマンドのパス',
+    'descIf_cmd_path' => 'if コマンドのパス',
     'descIf_down_cmd' => '仮想 IP を停止するために実行するコマンド',
     'descIf_up_cmd' => '仮想 IP を起動するために実行するコマンド',
     'descIgnore_leading_white_space' => 'load balance時のSQL文行頭の空白を無視',
@@ -110,13 +113,14 @@ $message = array(
     'descOther_pgpool_port' => '監視する pgpool-II が稼働するポート番号',
     'descOther_wd_port' => '監視する watchdog が稼働するポート番号',
     'descParallel_mode' => 'パラレルモードでpgpoolを運転',
-    'descPcp_port' => 'pgpool-IIが受け付けているポート番号',
+    'descPcp_port' => 'pcpがTCP/IPコネクションを受け付けるポート番号',
+    'descPcp_listen_addresses' => 'pcpがTCP/IPコネクションを受け付けるアドレス',
     'descPcp_socket_dir' => 'pcpがコネクションを受け付けるUnix domain socketディレクトリ',
     'descPcp_timeout' => 'この時間内にクライアントから応答がない場合はコネクションを切断して終了',
     'descPgpool2_hostname' => 'pgpool2 が動作しているホスト名',
     'descPool_passwd' => 'md5 認証で用いる認証ファイル',
     'descPing_path' => 'ping コマンドのパス',
-    'descPort' => 'pgpoolがコネクションを受け付けるポート番号',
+    'descPort' => 'pgpoolがTCP/IPコネクションを受け付けるポート番号',
     'descPrint_timestamp' => 'pgpoolのログにタイムスタンプを追加',
     'descRecovery_user' => 'リカバリを行うためのPostgreSQLユーザ',
     'descRecovery_password' => 'リカバリを行うためのPostgreSQLユーザパスワード',
@@ -131,12 +135,15 @@ $message = array(
     'descReplication_timeout' => 'デッドロックを監視するためのタイムアウト時間。'.
                                  '厳密でないレプリケーションモードでは、デッドロックが発生しやすくなります。',
     'descReset_query_list' => 'セッションが終了するときにコネクションを初期化するためのSQLコマンド',
+    'descSearch_primary_node_timeout' => 'フェイルオーバーが起きた時にプライマリノードを検索する際のタイムアウト時間(秒)',
+    'descSerialize_accept' => 'クライアントからの接続受け付け時、accept() をシリアライズする',
     'descSocket_dir' => 'pgpoolがコネクションを受け付けるUnix domain socketディレクトリ',
     'descSsl' => 'pgpool-IIとバックエンドの間のSSL接続',
     'descSsl_ca_cert' => 'opensslの-CAFileに指定するパス',
     'descSsl_ca_cert_dir' => 'opensslの-CApathに指定するディレクトリパス',
     'descSsl_cert' => 'フロントエンドとの接続に使用する公開x509証明書のフルパス',
     'descSsl_key' => 'フロントエンドとの接続に使用するプライベートキーファイルのフルパス',
+    'descSr_check_database' => 'ストリーミングレプリケーションの遅延チェックを行なう対象のデータベース名',
     'descSr_check_period' => 'ストリーミングレプリケーションの遅延チェックの間隔(秒)',
     'descSr_check_user' => 'ストリーミングレプリケーションの遅延チェックを行うユーザ',
     'descSr_check_password' => 'ストリーミングレプリケーションの遅延チェックを行うユーザのパスワード',
@@ -151,12 +158,14 @@ $message = array(
     'descTrusted_servers' => '上位サーバのコンマ区切りのリスト',
     'descUse_watchdog' => 'watchdog 機能の有無',
     'descWd_authkey' => 'wachdog 間通信で用いられる認証キー',
-    'descWd_escalation_command' => 'アクティブ昇格時に実行するコマンド',
+    'descWd_de_escalation_command' => 'マスタ(コーディネータ)降格時に実行するコマンド',
+    'descWd_escalation_command' => 'マスタ(コーディネータ)昇格時に実行するコマンド',
     'descWd_heartbeat_deadtime' => '障害発生とみなすまでの猶予(秒)',
     'descWd_heartbeat_keepalive' => 'ハートビート信号を送信する間隔(秒)',
     'descWd_heartbeat_port' => 'ハートビート信号を受信するポート番号',
     'descWd_hostname' => 'watchdog プロセスが相互監視を受信するためのホスト名',
     'descWd_interval' => '死活監視の間隔(秒)',
+    'descWd_ipc_socket_dir' => 'watchdog の IPC(プロセス間通信)で受け付ける UNIX ドメインソケットが作成されるディレクトリ',
     'descWd_life_point' => '死活監視のリトライ回数',
     'descWd_lifecheck_dbname' => '死活監視を行なうために接続するデータベース',
     'descWd_lifecheck_method' => '死活監視の方法',
@@ -164,6 +173,7 @@ $message = array(
     'descWd_lifecheck_password' => '死活監視を行なうユーザのパスワード',
     'descWd_lifecheck_user' => '死活監視を行なうユーザ',
     'descWd_port' => 'watchdog プロセスが相互監視を受信するためのポート番号',
+    'descWd_priority' => '自身の watchdog ノードがリーダに選ばれる優先度',
     'descWhite_function_list' => 'データベースに書き込みを行なわないカンマ区切りの関数のリスト',
     'descWhite_memqcache_table_list' => 'SELECT結果をキャッシュしたいテーブル名のカンマ区切りのリスト',
 
diff --git a/libs/plugins/function.custom_input.php b/libs/plugins/function.custom_input.php
new file mode 100644
index 0000000..e4afda8
--- /dev/null
+++ b/libs/plugins/function.custom_input.php
@@ -0,0 +1,29 @@
+',
+        $param_in_form, $params[$param]
+    );
+
+    if ($errors[$param]) {
+        $rtn .= '

'. + 'Error '. $errors[$param]. + '

'; + } + + if (isset($echo)) { + echo $rtn; + } else { + return $rtn; + } +} diff --git a/libs/plugins/function.custom_radio_bool.php b/libs/plugins/function.custom_radio_bool.php new file mode 100644 index 0000000..511e07a --- /dev/null +++ b/libs/plugins/function.custom_radio_bool.php @@ -0,0 +1,30 @@ + 'on', 0 => 'off'); + + echo '
'; + foreach ($val_arr as $val => $label) { + $radio_id = "{$param}_{$val}"; + + printf(''. + '', + $param_in_form, $radio_id, $val, ($val == $checked_val) ? 'checked' : NULL, + $radio_id, $label); + } + + if ($error) { + echo '
'. $error; + } + + echo '
'; +} diff --git a/libs/plugins/function.custom_select.php b/libs/plugins/function.custom_select.php new file mode 100644 index 0000000..e08f48a --- /dev/null +++ b/libs/plugins/function.custom_select.php @@ -0,0 +1,26 @@ +', $param); + foreach ($select_options[$param] as $key => $val) { + $rtn .= sprintf( + '', + $key, ($val == $user_val) ? 'selected' : NULL, $val + ); + } + $rtn .= ''; + + if ($errors[$param]) { + $rtn .='
'. $errors[$param]; + } + + echo $rtn; +} diff --git a/libs/plugins/function.custom_table_pgconfig.php b/libs/plugins/function.custom_table_pgconfig.php new file mode 100644 index 0000000..c1b2366 --- /dev/null +++ b/libs/plugins/function.custom_table_pgconfig.php @@ -0,0 +1,25 @@ + + + {$message['strParameter']} + {$message['strValue']} + + +EOT; + + if (isset($tfoot) && $tfoot == FALSE) { return; } + +echo << + + + + +EOT; +} diff --git a/pgconfig.php b/pgconfig.php index 4d93971..e4c9bc0 100644 --- a/pgconfig.php +++ b/pgconfig.php @@ -19,12 +19,11 @@ * is" without express or implied warranty. * * @author Ryuma Ando - * @copyright 2003-2014 PgPool Global Development Group + * @copyright 2003-2015 PgPool Global Development Group * @version CVS: $Id$ */ require_once('common.php'); -require('definePgpoolConfParam.php'); $tpl->assign('help', basename( __FILE__, '.php')); if (!isset($_SESSION[SESSION_LOGIN_USER])) { @@ -41,6 +40,27 @@ if (isset($_POST['action'])) { $action = FALSE; } +/* --------------------------------------------------------------------- */ +/* Set parameters' info and current vales */ +/* --------------------------------------------------------------------- */ + +// Get parameters' info +$pgpoolConfigParamAll = $pgpoolConfigParam + $pgpoolConfigBackendParam + + $pgpoolConfigWdOtherParam + $pgpoolConfigHbDestinationParam; +$tpl->assign('pgpoolConfigParamAll', $pgpoolConfigParamAll); + +$configValue = readConfigParams(); +foreach ($pgpoolConfigParam as $key => $value) { + if (!isset($configValue[$key]) ) { + $configValue[$key] = (isset($value['default'])) ? + $value['default'] : NULL; + } +} + +// Get current values +$params = $configValue; +$tpl->assign('params', $params); + /* --------------------------------------------------------------------- */ /* Add or Cancel */ /* --------------------------------------------------------------------- */ @@ -82,12 +102,6 @@ switch ($action) { /** * check $configFile */ -$configValue = readConfigParams(); -foreach ($pgpoolConfigParam as $key => $value) { - if (!isset($configValue[$key]) ) { - $configValue[$key] = $value['default']; - } -} switch ($action) { case 'update': @@ -96,8 +110,7 @@ switch ($action) { if (! $error) { if (is_writable(_PGPOOL2_CONFIG_FILE)) { - writeConfigFile($configValue, $pgpoolConfigParam); - $configValue = readConfigParams(); + writeConfigFile($configValue, $pgpoolConfigParamAll); $tpl->assign('status', 'success'); } else { @@ -128,7 +141,7 @@ switch ($action) { } if (is_writable(_PGPOOL2_CONFIG_FILE)) { - writeConfigFile($configValue, $pgpoolConfigParam); + writeConfigFile($configValue, $pgpoolConfigParamAll); $configValue = readConfigParams(); } else { @@ -165,7 +178,6 @@ if (!isset($configValue['other_pgpool_hostname'])) { $configValue['other_wd_port'][0] = NULL; } -$tpl->assign('params', $configValue); $tpl->assign('error', $error); $tpl->display('pgconfig.tpl'); @@ -182,42 +194,51 @@ $tpl->display('pgconfig.tpl'); * @param array $configParam * @param string $error */ -function check($key, $value, &$configParam ,&$error) +function check($key, $define, &$configParam ,&$error) { - //if (!isset($configParam[$key])) { continue; } - if (!isset($configParam[$key])) { return; } + if (! paramExists($key) || ! isset($configParam[$key])) { return; } - $type = $value['type']; - $result = FALSE; - switch ($type) { + if (isset($define['parent'])) { + $ignore_ok = FALSE; + foreach ($define['parent'] as $_param => $_expected_value) { + if (! isset($configParam[$_param]) || + $configParam[$_param] != $_expected_value) + { + $ignore_ok = TRUE; + } + if ($ignore_ok) { return; } + } + } + + $is_ok = FALSE; + switch ($define['type']) { case 'B': - $result = checkBoolean($configParam[$key]); + $is_ok = checkBoolean($configParam[$key]); // allow true/false and on/off as input format, // but write with only on/off format. - if ($result) { - if ($configParam[$key] == 'true') { - $configParam[$key] = 'on'; - } elseif ($configParam[$key] == 'false') { - $configParam[$key] = 'off'; - } + if ($configParam[$key] == 'true') { + $configParam[$key] = 'on'; + } elseif ($configParam[$key] == 'false') { + $configParam[$key] = 'off'; } break; case 'C': - $result = checkString($configParam[$key], $value); + $is_ok = checkString($configParam[$key], $define); break; case 'F': - $result = checkFloat($configParam[$key], $value['min'], $value['max']); + $is_ok = checkFloat($configParam[$key], $define['min'], $define['max']); break; case 'N': - $result = checkInteger($configParam[$key], $value['min'], $value['max']); + $is_ok = checkInteger($configParam[$key], $define['min'], $define['max']); break; } - if (!$result) { + + if ($is_ok === FALSE) { $error[$key] = TRUE; } } @@ -315,7 +336,7 @@ function checkLogical($configValue) } // syslog - if ($configValue['log_destination']) { + if ($configValue['log_destination'] && $configValue['log_destination'] == 'syslog') { if (empty($configValue['syslog_facility'])) { $errors['syslog_facility'] = TRUE; } if (empty($configValue['syslog_ident'])) { $errors['syslog_ident'] = TRUE; } } @@ -379,96 +400,56 @@ function checkLogical($configValue) * @param array $configValue * @param array $pgpoolConfigParam */ -function writeConfigFile($configValue, $pgpoolConfigParam) +function writeConfigFile($configValue, $pgpoolConfigParamAll) { - $configFile = @file(_PGPOOL2_CONFIG_FILE); - - $tmpConfigFile = array(); - for ($i = 0; $i < count($configFile); $i++) { - $line = $configFile[$i]; + $configFile = array(); + $originalConfigFile = @file(_PGPOOL2_CONFIG_FILE); + foreach ($originalConfigFile as $line) { + // Not-empty lines if (preg_match("/^\w/", $line)) { list($key, $value) = explode("=", $line); $key = trim($key); - if (!preg_match("/^backend_hostname/", $key) && - !preg_match("/^backend_port/", $key) && - !preg_match("/^backend_weight/", $key) && - !preg_match("/^backend_data_directory/", $key) && - !preg_match("/^backend_flag/", $key) && - !preg_match("/^other_pgpool_hostname/", $key) && - !preg_match("/^other_pgpool_port/", $key) && - !preg_match("/^other_wd_port/", $key) && - !preg_match("/^heartbeat_device/", $key) && - !preg_match("/^heartbeat_destination_port/", $key) && - !preg_match("/^heartbeat_destination/", $key) - ) - { - $tmpConfigFile[] = $line; - } + $num = preg_replace('/[^0-9]/', NULL, $key); + $key_wo_num = str_replace($num, NULL, $key); - } else { - $tmpConfigFile[] = $line; - } - } - $configFile = $tmpConfigFile; + // Modify the parameter' value if posted. + // (Ignore the params like "backend_hostname_0" which will be arranged in below) + if (! isset($pgpoolConfigParamAll[$key_wo_num]['multiple'])) { + if (isset($configValue[$key_wo_num])) { + $value = $configValue[$key]; + if (strcmp($pgpoolConfigParamAll[$key_wo_num]['type'], "C") == 0) { + $value = "'{$value}'"; + } + $configFile[] = "{$key_wo_num} = {$value}\n"; - foreach ($pgpoolConfigParam as $key => $value) { - $isWrite = FALSE; - for ($j = 0; $j < count($configFile); $j++) { - $line = $configFile[$j]; - $line = trim($line); - - if (preg_match("/^$key/", $line)) { - if (strcmp($pgpoolConfigParam[$key]['type'], "C") == 0) { - $configFile[$j] = $key . " = '" . $configValue[$key] . "'\n"; } else { - $configFile[$j] = $key . " = " . $configValue[$key]."\n"; + $configFile[] = $line; } - $isWrite = TRUE; - break; } - } - if (!$isWrite && paramExists($key)) { - if (strcmp($pgpoolConfigParam[$key]['type'], "C") == 0) { - $configFile[] = $key . " = '" . $configValue[$key] . "'\n"; - } else { - $configFile[] = $key . " = " . $configValue[$key]."\n"; - } + // comment or empty lines + } else { + $configFile[] = $line; } } - if (isset($configValue['backend_hostname'])) { - for ($i = 0; $i < count($configValue['backend_hostname']); $i++) { + $param_names = getMultiParams(); + foreach ($param_names as $group => $key_arr) { + for ($i = 0; $i < count($configValue[$key_arr[0]]); $i++) { + foreach ($key_arr as $key) { + $value = (isset($configValue[$key][$i])) ? $configValue[$key][$i] : NULL; - $configFile[] = "backend_hostname$i = '" . $configValue['backend_hostname'][$i] . "'\n"; - $configFile[] = "backend_port$i = " . $configValue['backend_port'][$i] . "\n"; - $configFile[] = "backend_weight$i = " . $configValue['backend_weight'][$i] . "\n"; - $configFile[] = "backend_data_directory$i = '" . $configValue['backend_data_directory'][$i] . "'\n"; + if (strcmp($pgpoolConfigParamAll[$key]['type'], "C") == 0) { + $value = "'{$value}'"; + } - if (paramExists('backend_flag')) { - $configFile[] = "backend_flag$i= '" . $configValue['backend_flag'][$i] . "'\n"; + $configFile[] = "{$key}{$i} = {$value}\n"; } } } - if (isset($configValue['other_pgpool_hostname'])) { - for ($i = 0; $i < count($configValue['other_pgpool_hostname']); $i++) { - $configFile[] = "other_pgpool_hostname$i = '" . $configValue['other_pgpool_hostname'][$i] . "'\n"; - $configFile[] = "other_pgpool_port$i = " . $configValue['other_pgpool_port'][$i] . "\n"; - $configFile[] = "other_wd_port$i = " . $configValue['other_wd_port'][$i] . "\n"; - } - } - - if (isset($configValue['heartbeat_destination'])) { - for ($i = 0; $i < count($configValue['heartbeat_destination']); $i++) { - $configFile[] = "heartbeat_destination$i = '" . $configValue['heartbeat_destination'][$i] . "'\n"; - $configFile[] = "heartbeat_destination_port$i = " . $configValue['heartbeat_destination_port'][$i] . "\n"; - $configFile[] = "heartbeat_device$i = '" . $configValue['heartbeat_device'][$i] . "'\n"; - } - } - $outfp = fopen(_PGPOOL2_CONFIG_FILE, 'w'); foreach ($configFile as $line) { fputs($outfp, $line); @@ -548,10 +529,7 @@ function arrangePostData() $configValue = array(); foreach ($pgpoolConfigParam as $key => $value) { - if ($pgpoolConfigParam[$key]['type'] == 'B') { - $configValue[$key] = (isset($_POST[$key])) ? 'on' : 'off'; - - } elseif (isset($_POST[$key])) { + if (isset($_POST[$key])) { $configValue[$key] = trim($_POST[$key]); } } @@ -588,7 +566,7 @@ function doAdd($configValue) if (isset($_POST['backend_data_directory'])) { $configValue['backend_data_directory'] = $_POST['backend_data_directory']; } else { - $configValue['backend_data_directory'][0] = NULL; + $configValue['backend_data_directory'][0] = NULL; } if (paramExists('backend_flag')) { @@ -747,7 +725,7 @@ function doCheck() // backend_hostname $result = checkString($configValue['backend_hostname'][$i], $pgpoolConfigBackendParam['backend_hostname']); - if (!$result) { + if (! $result) { $error['backend_hostname'][$i] = TRUE; } @@ -755,7 +733,7 @@ function doCheck() $result = checkInteger($configValue['backend_port'][$i], $pgpoolConfigBackendParam['backend_port']['min'], $pgpoolConfigBackendParam['backend_port']['max']); - if (!$result) { + if (! $result) { $error['backend_port'][$i] = TRUE; } @@ -763,14 +741,14 @@ function doCheck() $result = checkFloat($configValue['backend_weight'][$i], $pgpoolConfigBackendParam['backend_weight']['min'], $pgpoolConfigBackendParam['backend_weight']['max']); - if (!$result) { + if (! $result) { $error['backend_weight'][$i] = TRUE; } // backend_data_directory $result = checkString($configValue['backend_data_directory'][$i], $pgpoolConfigBackendParam['backend_data_directory']); - if (!$result) { + if (! $result) { $error['backend_data_directory'][$i] = TRUE; } @@ -778,7 +756,7 @@ function doCheck() if (paramExists('backend_flag')) { $result = checkString($configValue['backend_flag'][$i], $pgpoolConfigBackendParam['backend_flag']); - if (!$result) { + if (! $result) { $error['backend_flag'][$i] = TRUE; } } @@ -800,7 +778,7 @@ function doCheck() // heartbeat_destination $result = checkString($configValue['heartbeat_destination'][$i], $pgpoolConfigHbDestinationParam['heartbeat_destination']); - if (!$result) { + if (! $result) { $error['heartbeat_destination'][$i] = TRUE; } @@ -808,14 +786,14 @@ function doCheck() $result = checkInteger($configValue['heartbeat_destination_port'][$i], $pgpoolConfigHbDestinationParam['heartbeat_destination_port']['min'], $pgpoolConfigHbDestinationParam['heartbeat_destination_port']['max']); - if (!$result) { + if (! $result) { $error['heartbeat_destination_port'][$i] = TRUE; } // heartbeat_device $result = checkString($configValue['heartbeat_device'][$i], $pgpoolConfigHbDestinationParam['heartbeat_device']); - if (!$result) { + if (! $result) { $error['heartbeat_device'][$i] = TRUE; } } @@ -836,7 +814,7 @@ function doCheck() // other_pgpool_hostname $result = checkString($configValue['other_pgpool_hostname'][$i], $pgpoolConfigWdOtherParam['other_pgpool_hostname']); - if (!$result) { + if (! $result) { $error['other_pgpool_hostname'][$i] = TRUE; } @@ -844,7 +822,7 @@ function doCheck() $result = checkInteger($configValue['other_pgpool_port'][$i], $pgpoolConfigWdOtherParam['other_pgpool_port']['min'], $pgpoolConfigWdOtherParam['other_pgpool_port']['max']); - if (!$result) { + if (! $result) { $error['other_pgpool_port'][$i] = TRUE; } @@ -852,7 +830,7 @@ function doCheck() $result = checkInteger($configValue['other_wd_port'][$i], $pgpoolConfigWdOtherParam['other_wd_port']['min'], $pgpoolConfigWdOtherParam['other_wd_port']['max']); - if (!$result) { + if (! $result) { $error['other_wd_port'][$i] = TRUE; } } diff --git a/queryCache.php b/queryCache.php index c5cf584..6373ef7 100644 --- a/queryCache.php +++ b/queryCache.php @@ -70,12 +70,7 @@ $sysDbParam['password'] = $sysDbParam['system_db_password']; $sysDbSchema = $sysDbParam['system_db_schema']; $conn = openDBConnection($sysDbParam); -if ($conn == FALSE) { - $errorCode = 'e2001'; - $tpl->assign('errorCode', $errorCode); - $tpl->display('error.tpl'); - exit(); -} +if ($conn == FALSE) { errorPage('e2001'); } $deleteRow = NULL; if ($action == 'delete') { @@ -91,7 +86,7 @@ if ($action == 'delete') { $escaped = pg_escape_string($hashArray[$i]); $sql .= "hash = '$escaped' OR "; } - $sql .= "hash = '$hashArray[$i]'"; + $sql .= "hash = '{$hashArray[$i]}'"; $rs = execQuery($conn, $sql); $deleteRow = pg_affected_rows($rs); } @@ -163,12 +158,7 @@ if ($sort == "descending") { } $rs = execQuery($conn, $sql); -if ($rs == FALSE) { - $errorCode = 'e2002'; - $tpl->assign('errorCode', $errorCode); - $tpl->display('error.tpl'); - exit(); -} +if ($rs == FALSE) { errorPage('e2002'); } $result = pg_fetch_all($rs); diff --git a/status.php b/status.php index 889b0db..41347eb 100644 --- a/status.php +++ b/status.php @@ -19,7 +19,7 @@ * is" without express or implied warranty. * * @author Ryuma Ando - * @copyright 2003-2014 PgPool Global Development Group + * @copyright 2003-2015 PgPool Global Development Group * @version SVN: $Id$ */ @@ -202,7 +202,7 @@ function setNodeInfoFromConf() global $tpl; global $is_pgpool_running; - if (!$is_pgpool_running) { + if (! $is_pgpool_running) { $nodeInfo = array(); $configValue = readConfigParams(array('backend_hostname', 'backend_port')); @@ -216,7 +216,7 @@ function setNodeInfoFromConf() $tpl->assign('nodeInfo', $nodeInfo); } - $configValue = readConfigParams('backend_hostname'); + $configValue = readConfigParams(array('backend_hostname')); $tpl->assign('next_node_num', (isset($configValue['backend_hostname'])) ? max(array_keys($configValue['backend_hostname'])) + 1 : 0); } @@ -413,7 +413,7 @@ function _addNewBackend() } // Get next nodeNumber - $configValue = readConfigParams('backend_hostname'); + $configValue = readConfigParams(array('backend_hostname')); $i = (isset($configValue['backend_hostname'])) ? max(array_keys($configValue['backend_hostname'])) + 1 : 0; @@ -428,7 +428,7 @@ function _addNewBackend() // Write pgpool.conf $outfp = fopen(_PGPOOL2_CONFIG_FILE, 'a'); - if (!$outfp) { return FALSE; } + if (! $outfp) { return FALSE; } foreach ($lines as $line) { if (fputs($outfp, $line) === FALSE) { return FALSE; @@ -457,8 +457,8 @@ function _removeBackend() // Read execept backend info of node $nodeNumber $lines_to_write = array(); $fd = fopen(_PGPOOL2_CONFIG_FILE, 'r'); - if (!$fd) { return FALSE; } - while (!feof($fd)) { + if (! $fd) { return FALSE; } + while (! feof($fd)) { $line = fgets($fd); if (strpos($line, "backend_hostname") !== FALSE || @@ -493,7 +493,7 @@ function _removeBackend() // Write editted lines $fd = fopen(_PGPOOL2_CONFIG_FILE, 'w'); - if (!$fd) { return FALSE; } + if (! $fd) { return FALSE; } foreach ($lines_to_write as $line) { if (fputs($fd, $line) === FALSE) { return FALSE; @@ -516,9 +516,19 @@ function _doPgCtl($nodeNumber, $pg_ctl_action) if (isSuperUser($_SESSION[SESSION_LOGIN_USER]) == FALSE) { return FALSE; } - $conn = @pg_connect(conStr($nodeNumber, 'login')); + $params = readConfigParams(array( + 'backend_hostname', 'backend_port', 'backend_weight', + )); + $conn = openDBConnection(array( + 'host' => $params['backend_hostname'][$nodeNum], + 'port' => $params['backend_port'][$nodeNum], + 'dbname' => 'template1', + 'user' => $_SESSION[SESSION_LOGIN_USER], + 'password' => $_SESSION[SESSION_LOGIN_USER_PASSWORD], + )); + if ($conn == FALSE) { - @pg_close($conn); + closeDBConnection($conn); return FALSE; } $query = sprintf("SELECT pgpool_pgctl('%s', '%s')", @@ -526,7 +536,7 @@ function _doPgCtl($nodeNumber, $pg_ctl_action) (isset($_POST['stop_mode'])) ? $_POST['stop_mode'] : NULL); $result = execQuery($conn, $query); - @pg_close($conn); + closeDBConnection($conn); return $result; } diff --git a/templates/config.tpl b/templates/config.tpl index 4606726..4896b57 100644 --- a/templates/config.tpl +++ b/templates/config.tpl @@ -38,177 +38,71 @@ - - (string) - + (string) + {custom_select param='lang' echo=true} - - (float) - - + + (float) + {custom_select param='version' echo=true} - {if isset($errors.pgpool_config_file)}{else}{/if} - - (string) - - {if isset($errors.pgpool_config_file)} -
{$errors.pgpool_config_file|escape} - {/if} - + (string) + {custom_input param='pgpool_config_file' echo=true} + - {if isset($errors.password_file)}{else}{/if} - - (string) - - {if isset($errors.password_file)} -
{$errors.password_file|escape} - {/if} - + (string) + {custom_input param='password_file' echo=true} + - {if isset($errors.pgpool_command)}{else}{/if} - - (string) - - {if isset($errors.pgpool_command)} -
{$errors.pgpool_command|escape} - {/if} - + (string) + {custom_input param='pgpool_command' echo=true} + + + {if hasMemqCache() == false} - - - (string) - {$message.strCmdC|escape}(-c) - - {if $params.c == 1} - - {else} - - {/if} - {if isset($errors.c)} -
{$errors.c|escape} - {/if} - + {$message.strCmdC|escape} (-c) + {custom_radio_bool param='c' echo=true} + + {/if} + + {$message.strCmdLargeD|escape} (-D) + {custom_radio_bool param='D' param_in_form='large_d' echo=true} + + {$message.strCmdN|escape} (-n) + {custom_radio_bool param='n' echo=true} + + + {if hasMemqCache()} + {$message.strCmdLargeC|escape} (-C) + {custom_radio_bool param='C' param_in_form='large_c'} + {/if} - {$message.strCmdLargeD|escape}(-D) - - {if $params.D == 1} - - {else} - - {/if} - {if isset($errors.D)} -
{$errors.D|escape} - {/if} - - {$message.strCmdN|escape}(-n) - - {if $params.n == 1} - - {else} - - {/if} - {if isset($errors.n)} -
{$errors.n|escape} - {/if} - - {$message.strCmdLargeC|escape}(-C) - - {if $params.C == 1} - - {else} - - {/if} - {if isset($errors.C)} -
{$errors.n|escape} - {/if} - - {$message.strCmdD|escape}(-d) - - {if $params.d == 1} - - {else} - - {/if} - {if isset($errors.d)} -
{$errors.d|escape} - {/if} - - {$message.strCmdM|escape}(-m) - {if isset($errors.pgpool_logfile)} -
{$errors.pgpool_logfile|escape} - {/if} - + (string) + {custom_input param='pgpool_logfile' echo=true} + - {if isset($errors.pcp_client_dir)}{else}{/if} - - (string) - - {if isset($errors.pcp_client_dir)} -
{$errors.pcp_client_dir|escape} - {/if} - + (string) + {custom_input param='pcp_client_dir' echo=true} + - {if isset($errors.pcp_hostname)}{else}{/if} - - (string) - - {if isset($errors.pcp_hostname)} -
{$errors.pcp_hostname|escape} - {/if} - + (string) + {custom_input param='pcp_hostname' echo=true} + - {if isset($errors.pcp_refresh_time)}{else}{/if} - - (integer) - - {if isset($errors.pcp_refresh_time)} -
{$errors.pcp_refresh_time|escape} - {/if} - + (string) + {custom_input param='pcp_refresh_time' echo=true} + diff --git a/templates/elements/pgconfig_submenu.tpl b/templates/elements/pgconfig_submenu.tpl new file mode 100644 index 0000000..dee8ca9 --- /dev/null +++ b/templates/elements/pgconfig_submenu.tpl @@ -0,0 +1,30 @@ + diff --git a/templates/pgconfig.tpl b/templates/pgconfig.tpl index 8dafe27..d31303d 100644 --- a/templates/pgconfig.tpl +++ b/templates/pgconfig.tpl @@ -1,75 +1,11 @@ - + {$message.strPgConfSetting|escape} - -{/literal} + + @@ -79,10 +15,16 @@ function delHeartbeatDestination(num){
- + + + +

{$message.strPgConfSetting|escape}

{* --------------------------------------------------------------------- * * Succeeed / Failed * @@ -106,1784 +48,696 @@ function delHeartbeatDestination(num){ {/if} {/if} -

{$message.strPgConfSetting|escape}

- - -
- - + + + - {* --------------------------------------------------------------------- * - * Connections * - * --------------------------------------------------------------------- *} -

Connections

+ {* ===================================================================== *} +

Connections

+ {* ===================================================================== *} - - - - - - - - - - - - - + {custom_table_pgconfig} + {* --------------------------------------------------------------------- *} - + {* --------------------------------------------------------------------- *} - - - -
listen_addresses (string) * -
- - - - - -
port (integer) * -
- - - - - -
socket_dir (string) * -
- - + {custom_tr_pgconfig param='listen_addresses'} + {custom_tr_pgconfig param='port'} + {custom_tr_pgconfig param='socket_dir'} {if paramExists('listen_backlog_multiplier')} - - - -
listen_backlog_multiplier (integer) * -
- + {custom_tr_pgconfig param='listen_backlog_multiplier'} + {/if} + {if paramExists('serialize_accept')} + {custom_tr_pgconfig param='serialize_accept'} {/if} - - {if paramExists('backend_socket_dir')} - - - -
backend_socket_dir (string) * -
- + {custom_tr_pgconfig param='backend_socket_dir'} {/if} + + {* --------------------------------------------------------------------- *} - + {* --------------------------------------------------------------------- *} - - - -
pcp_port (integer) * -
- - - - - -
pcp_socket_dir (string) * -
- + {custom_tr_pgconfig param='pcp_listen_addresses'} + {custom_tr_pgconfig param='pcp_port'} + {custom_tr_pgconfig param='pcp_socket_dir'} + + {* --------------------------------------------------------------------- *} - + {* --------------------------------------------------------------------- *} - - - -
enable_pool_hba (bool) -
- - + {custom_tr_pgconfig param='enable_pool_hba'} {if paramExists('pool_passwd')} - - - -
pool_passwd (string) * -
- + {custom_tr_pgconfig param='pool_passwd'} {/if} - - - - -
authentication_timeout (integer) -
- - - {* --------------------------------------------------------------------- *} + {custom_tr_pgconfig param='authentication_timeout'} + {if paramExists('ssl')} + + {* --------------------------------------------------------------------- *} + {* --------------------------------------------------------------------- *} - - - -
ssl (bool) * -
- - - - - -
ssl_key (string) * -
- - - - - -
ssl_cert (string) * -
- - - - - -
ssl_ca_cert (string) * -
- - - - - -
ssl_ca_cert_dir (string) * -
- + {custom_tr_pgconfig param='ssl'} + + + + {custom_tr_pgconfig param='ssl_key'} + {custom_tr_pgconfig param='ssl_cert'} + {custom_tr_pgconfig param='ssl_ca_cert'} + {custom_tr_pgconfig param='ssl_ca_cert_dir'} + {/if}
{$message.strParameter|escape}{$message.strValue|escape}
pgpool Connection Settings
pgpool Communication Manager Connection Settings
Authentication
SSL Connections
- - {* --------------------------------------------------------------------- * - * Pools * - * --------------------------------------------------------------------- *} -

Pools

+ {* ===================================================================== *} +

Pools

+ {* ===================================================================== *} - - - - - - - - - - - - + {custom_table_pgconfig} + {* --------------------------------------------------------------------- *} - + {* --------------------------------------------------------------------- *} - - - -
num_init_children (integer) * -
- - - - - -
max_pool (integer) * -
- + {custom_tr_pgconfig param='num_init_children'} + {custom_tr_pgconfig param='max_pool'} + + {* --------------------------------------------------------------------- *} - + {* --------------------------------------------------------------------- *} - - - -
child_life_time (integer) -
- - - - - -
child_max_connections (integer) -
- - - - - -
connection_life_time (integer) -
- - - - - -
client_idle_limit (integer) -
- - + {custom_tr_pgconfig param='child_life_time'} + {custom_tr_pgconfig param='child_max_connections'} + {custom_tr_pgconfig param='connection_life_time'} + {custom_tr_pgconfig param='client_idle_limit'}
{$message.strParameter|escape}{$message.strValue|escape}
Pool size
Life time
- - {* --------------------------------------------------------------------- * - * Backends * - * --------------------------------------------------------------------- *} -

Backends

+ {* ===================================================================== *} +

Backends

+ {* ===================================================================== *} - - - - - - - - - - {if isset($isAdd) && $isAdd == true} - - - - - - {else} - - - - - - {/if} - + {custom_table_pgconfig} + + + {* --------------------------------------------------------------------- *} + + {* --------------------------------------------------------------------- *} {foreach from=$params.backend_hostname key=node_num item=v} - - - - -
backend_hostname{$node_num} (string) -
- - - - - - -
backend_port{$node_num|escape} (integer) -
- - - - - -
backend_weight{$node_num|escape} (float) -
- - - - - -
backend_data_directory{$node_num|escape} (string) -
- - - {if paramExists('backend_flag')} - - - -
backend_flag{$node_num|escape} (string) * -
- - {/if} + + {custom_tr_pgconfig param='backend_hostname' num=$node_num} + {custom_tr_pgconfig param='backend_port' num=$node_num} + {custom_tr_pgconfig param='backend_weight' num=$node_num} + {custom_tr_pgconfig param='backend_data_directory' num=$node_num} + {if paramExists('backend_flag')} + {custom_tr_pgconfig param='backend_flag' num=$node_num} + {/if} {/foreach} {if isset($isAdd) && $isAdd == true} - - - - - - - - - - - - - - - - - - - - - - + + {custom_tr_pgconfig param='backend_hostname' num=$node_num+1} + {custom_tr_pgconfig param='backend_port' num=$node_num+1} + {custom_tr_pgconfig param='backend_weight' num=$node_num+1} + {custom_tr_pgconfig param='backend_data_directory' num=$node_num+1} {if paramExists('backend_flag')} - - - - + {custom_tr_pgconfig param='backend_flag' num=$node_num+1} {/if} {/if} -
{$message.strParameter|escape}{$message.strValue|escape}
-
-
Backend node + +
- node {$node_num} -
+ Backend node {$node_num} +
- node {$node_num + 1} -
backend_hostname{$smarty.section.num.index} (string)
-
-
backend_port{$smarty.section.num.index|escape} (integer)
-
backend_weight{$smarty.section.num.index|escape} (float)
-
backend_data_directory{$smarty.section.num.index|escape} (string)
+ Backend node {$node_num + 1} + +
-
backend_flag{$smarty.section.num.index|escape} *
- - {* --------------------------------------------------------------------- * - * Logs * - * --------------------------------------------------------------------- *} -

Logs

+ {* ===================================================================== *} +

Logs

+ {* ===================================================================== *} - - - - - - - - - - - - - - - - {* --------------------------------------------------------------------- *} + {custom_table_pgconfig} {if paramExists('log_destination')} + + {* --------------------------------------------------------------------- *} + {* --------------------------------------------------------------------- *} - - {if isset($error.log_destination)} - - - {/if} - - {* --------------------------------------------------------------------- *} - - + {custom_tr_pgconfig param='log_destination'} + - {if paramExists('log_line_prefix')} - - {if isset($error.log_line_prefix)} - - - {/if} + + {* --------------------------------------------------------------------- *} + + {* --------------------------------------------------------------------- *} - {if paramExists('print_timestamp')} - - - -
print_timestamp (bool) * - {if $params.print_timestamp == 'on'} -
+ {if paramExists('log_line_prefix')} + {custom_tr_pgconfig param='log_line_prefix'} {/if} - - {/if} + {if paramExists('print_timestamp')} + {custom_tr_pgconfig param='print_timestamp'} + {/if} + {custom_tr_pgconfig param='log_connections'} + {custom_tr_pgconfig param='log_hostname'} + {custom_tr_pgconfig param='log_statement'} + {if paramExists('log_per_node_statement')} + {custom_tr_pgconfig param='log_per_node_statement'} + {/if} + {if paramExists('log_standby_delay')} + {custom_tr_pgconfig param='log_standby_delay'} + {/if} + - - - -
log_connections (bool) - {if $params.log_connections == 'on'} -
- - - - - -
log_hostname (bool) - {/if} -
- - - - - -
log_statement (bool) -
- - - {if paramExists('log_per_node_statement')} - - {if isset($error.log_per_node_statement)} - - - {/if} + + {* --------------------------------------------------------------------- *} + + {* --------------------------------------------------------------------- *} - {if paramExists('log_standby_delay')} - - - -
log_standby_delay (string) -
- + {if paramExists('debug_level')} + {custom_tr_pgconfig param='debug_level'} + {/if} + {if paramExists('log_error_verbosity')} + {custom_tr_pgconfig param='log_error_verbosity'} + {/if} + {if paramExists('client_min_messages')} + {custom_tr_pgconfig param='client_min_messages'} + {/if} + {if paramExists('log_min_messages')} + {custom_tr_pgconfig param='log_min_messages'} + {/if} + {/if} - {* --------------------------------------------------------------------- *} - {if paramExists('syslog_facility')} + + {* --------------------------------------------------------------------- *} + {* --------------------------------------------------------------------- *} - - {if isset($error.syslog_facility)} - - - - - {if isset($error.syslog_ident)} - - - {/if} - - {* --------------------------------------------------------------------- *} - - - - {if paramExists('debug_level')} - - - -
debug_level (integer) -
- - {/if} - - {if paramExists('log_error_verbosity')} - - - -
log_error_verbosity (string) -
- - {/if} - - {if paramExists('client_min_messages')} - - - -
client_min_messages (string) -
- - {/if} - - {if paramExists('log_min_messages')} - - - -
log_min_messages (string) -
- + {custom_tr_pgconfig param='syslog_facility'} + {custom_tr_pgconfig param='syslog_ident'} + {/if} - -
{$message.strParameter|escape}{$message.strValue|escape}
Where to log
{else}{/if} - -
log_destination *
What to log
{else}{/if} - -
log_line_prefix (string)
What to log
{else}{/if} - -
log_per_node_statement (bool)
Debug
Syslog specific
{else}{/if} - -
syslog_facility (string) *
{else}{/if} - -
syslog_ident (string) *
Debug
- {* --------------------------------------------------------------------- * - * File Locations * - * --------------------------------------------------------------------- *} -

File Locations

+ {* ===================================================================== *} +

File Locations

+ {* ===================================================================== *} - - - - - - - - - - - - - - - - -
logdir (string) * -
- + {custom_table_pgconfig} + + {custom_tr_pgconfig param='logdir'} {if paramExists('pid_file_name')} - - - -
pid_file_name (string) * -
- + {custom_tr_pgconfig param='pid_file_name'} {/if} -
{$message.strParameter|escape}{$message.strValue|escape}
- {* --------------------------------------------------------------------- * - * Connection Pooling * - * --------------------------------------------------------------------- *} -

Connection Pooling

+ {* ===================================================================== *} +

Connection Pooling

+ {* ===================================================================== *} - - - - - - - - - - - - - - - - - -
connection_cache (bool) * -
- - - - - -
reset_query_list (string) -
- + {custom_table_pgconfig} + + {custom_tr_pgconfig param='connection_cache'} + {custom_tr_pgconfig param='reset_query_list'}
{$message.strParameter|escape}{$message.strValue|escape}
- {* --------------------------------------------------------------------- * - * Replication Mode * - * --------------------------------------------------------------------- *} -

Replication Mode

+ {* ===================================================================== *} +

Replication Mode

+ {* ===================================================================== *} - - - - - - - - - - - - - - - - -
replication_mode (bool) * -
- - - - - -
replicate_select (bool) -
- - - - - -
insert_lock (bool) -
- + {custom_table_pgconfig} + + {custom_tr_pgconfig param='replication_mode'} + + + + {custom_tr_pgconfig param='replicate_select'} + {custom_tr_pgconfig param='insert_lock'} {if paramExists('lobj_lock_table')} - - - -
lobj_lock_table (string) -
- + {custom_tr_pgconfig param='lobj_lock_table'} {/if} + + {* --------------------------------------------------------------------- *} - + {* --------------------------------------------------------------------- *} - - - -
replication_stop_on_mismatch (bool) -
- - + {custom_tr_pgconfig param='replication_stop_on_mismatch'} {if paramExists('failover_if_affected_tuples_mismatch')} - - - -
failover_if_affected_tuples_mismatch (bool) -
- + {custom_tr_pgconfig param='failover_if_affected_tuples_mismatch'} {/if} - {if paramExists('replication_timeout')} - - - -
replication_timeout (integer) -
- + {custom_tr_pgconfig param='replication_timeout'} {/if} -
{$message.strParameter|escape}{$message.strValue|escape}
Degenerate handling
- {* --------------------------------------------------------------------- * - * Load Balancing Mode * - * --------------------------------------------------------------------- *} -

Load Balancing Mode

+ {* ===================================================================== *} +

Load Balancing Mode

+ {* ===================================================================== *} - - - - - - - - - - - - - - - - - -
load_balance_mode (bool) * -
- - - - - -
ignore_leading_white_space (bool) -
- + {custom_table_pgconfig} + + + {custom_tr_pgconfig param='load_balance_mode'} + + + {custom_tr_pgconfig param='ignore_leading_white_space'} {if paramExists('white_function_list')} - - - -
white_function_list (string) -
- + {custom_tr_pgconfig param='white_function_list'} {/if} - {if paramExists('black_function_list')} - - - -
black_function_list (string) -
- + {custom_tr_pgconfig param='black_function_list'} {/if} - {if paramExists('database_redirect_preference_list')} - - - -
database_redirect_preference_list(string) -
- + {custom_tr_pgconfig param='database_redirect_preference_list'} {/if} - {if paramExists('app_name_redirect_preference_list')} - - - -
app_name_redirect_preference_list (string) -
- + {custom_tr_pgconfig param='app_name_redirect_preference_list'} {/if} - {if paramExists('allow_sql_comments')} - - - -
allow_sql_comments (bool) * -
- + {custom_tr_pgconfig param='allow_sql_comments'} {/if}
{$message.strParameter|escape}{$message.strValue|escape}
- {* --------------------------------------------------------------------- * - * Master/Slave Mode * - * --------------------------------------------------------------------- *} -

Master/Slave Mode

+ {* ===================================================================== *} +

Master/Slave Mode

+ {* ===================================================================== *} - - - - - - - - - - - - - - - - - -
master_slave_mode (bool) * -
- - - {if paramExists('master_slave_sub_mode')} - - - -
master_slave_sub_mode (string) * -
- - {/if} + {custom_table_pgconfig} - {* --------------------------------------------------------------------- *} + + {custom_tr_pgconfig param='master_slave_mode'} + - {if paramExists('sr_check_period')} - + {if paramExists('master_slave_sub_mode')} + + {custom_tr_pgconfig param='master_slave_sub_mode'} + - - - -
sr_check_period (integer) * -
- - - - - -
sr_check_user (string) * -
- - - - - -
sr_check_password (string) * -
- - {/if} + {if paramExists('follow_master_command')} + + {* --------------------------------------------------------------------- *} + + {* --------------------------------------------------------------------- *} - {if paramExists('delay_threshold')} - - - -
delay_threshold (integer) -
- + {custom_tr_pgconfig param='follow_master_command'} + {/if} + {/if} - {* --------------------------------------------------------------------- *} - - {if paramExists('follow_master_command')} - + + {if paramExists('sr_check_period')} + {* --------------------------------------------------------------------- *} + + {* --------------------------------------------------------------------- *} - - - -
follow_master_command (string) * -
- + {custom_tr_pgconfig param='sr_check_period'} + {custom_tr_pgconfig param='sr_check_user'} + {custom_tr_pgconfig param='sr_check_password'} + {if paramExists('sr_check_database')} + {custom_tr_pgconfig param='sr_check_database'} + {/if} {/if} + {if paramExists('delay_threshold')} + {custom_tr_pgconfig param='delay_threshold'} + {/if}
{$message.strParameter|escape}{$message.strValue|escape}
Streaming
Special commands
Special commands
Streaming
- {* --------------------------------------------------------------------- * - * Parallel Mode * - * --------------------------------------------------------------------- *} {if paramExists('parallel_mode')} -

{if hasMemqcache()}Parallel Mode{else}Parallel Mode and Query Cache{/if}

- - - - - - - - - - - - - - - - - - - -
parallel_mode (bool) * -
- - - {if hasMemqcache() == false} - - - -
enable_query_cache (bool) * -
- - {/if} + {* ===================================================================== *} +

+ {if hasMemqcache()} + Parallel Mode + {else} + Parallel Mode and Query Cache + {/if}

+ {* ===================================================================== *} - - {if isset($error.pgpool2_hostname)} - - {else} - - {/if} - - +
{$message.strParameter|escape}{$message.strValue|escape}
-
pgpool2_hostname (string) *
-
pgpool2_hostname (string) *
+ {custom_table_pgconfig} - {* --------------------------------------------------------------------- *} + + {custom_tr_pgconfig param='parallel_mode'} + - - - - - -
system_db_hostname (string) * -
- - - - - -
system_db_port (integer) * -
- - - - - -
system_db_dbname (string) * -
- - - - - -
system_db_schema (string) * -
- - - - - -
system_db_user (string) * -
- - - - - -
system_db_password (string) * -
- + + {custom_tr_pgconfig param='pgpool2_hostname'} + {if hasMemqcache() == false} + {custom_tr_pgconfig param='enable_query_cache'} + {/if} + - -
System DB info
+ + {* --------------------------------------------------------------------- *} + System DB info + {* --------------------------------------------------------------------- *} + + {custom_tr_pgconfig param='system_db_hostname'} + {custom_tr_pgconfig param='system_db_port'} + {custom_tr_pgconfig param='system_db_dbname'} + {custom_tr_pgconfig param='system_db_schema'} + {custom_tr_pgconfig param='system_db_user'} + {custom_tr_pgconfig param='system_db_password'} + + {/if} - {* --------------------------------------------------------------------- * - * Health Check * - * --------------------------------------------------------------------- *} -

Health Check

+ {* ===================================================================== *} +

Health Check

+ {* ===================================================================== *} - - - - - - - - - - - - - - - - -
health_check_timeout (integer) -
- - - - - -
health_check_period (integer) -
- - - - - -
health_check_user (string) -
- + {custom_table_pgconfig} + + {custom_tr_pgconfig param='health_check_period'} + {custom_tr_pgconfig param='health_check_timeout'} + {custom_tr_pgconfig param='health_check_user'} {if paramExists('health_check_password')} - - - -
health_check_password (string) -
- + {custom_tr_pgconfig param='health_check_password'} + {/if} + {if paramExists('health_check_database')} + {custom_tr_pgconfig param='health_check_database'} {/if} - {if paramExists('health_check_max_retries')} - - - -
health_check_max_retries (integer) -
- + {custom_tr_pgconfig param='health_check_max_retries'} {/if} - {if paramExists('health_check_retry_delay')} - - - -
health_check_retry_delay (integer) -
- + {custom_tr_pgconfig param='health_check_retry_delay'} {/if} - {if paramExists('connect_timeout')} - - - -
connect_timeout (integer) -
- + {custom_tr_pgconfig param='connect_timeout'} {/if} -
{$message.strParameter|escape}{$message.strValue|escape}
- {* --------------------------------------------------------------------- * - * Failover and Failback * - * --------------------------------------------------------------------- *} -

Failover and Failback

+ {* ===================================================================== *} +

Failover and Failback

+ {* ===================================================================== *} - - - - - - - - - - - - - - - - - -
failover_command (string) -
- - - - - -
failback_command (string) -
- + {custom_table_pgconfig} + + {custom_tr_pgconfig param='failover_command'} + {custom_tr_pgconfig param='failback_command'} {if paramExists('fail_over_on_backend_error')} - - - -
fail_over_on_backend_error -
- + {custom_tr_pgconfig param='fail_over_on_backend_error'} + {/if} + {if paramExists('search_primary_node_timeout')} + {custom_tr_pgconfig param='search_primary_node_timeout'} {/if} -
{$message.strParameter|escape}{$message.strValue|escape}
- {* --------------------------------------------------------------------- * - * Online Recovery * - * --------------------------------------------------------------------- *} -

Online Recovery

+ {* ===================================================================== *} +

Online Recovery

+ {* ===================================================================== *} - - - - - - - - - - - - - - - - -
recovery_user (string) -
- - - - - -
recovery_password (string) -
- - - - - -
recovery_1st_stage_command (string) -
- - - - - -
recovery_2nd_stage_command (string) -
- - - - - -
recovery_timeout (integer) -
- - + {custom_table_pgconfig} + + + {custom_tr_pgconfig param='recovery_user'} + {custom_tr_pgconfig param='recovery_password'} + {custom_tr_pgconfig param='recovery_1st_stage_command'} + {custom_tr_pgconfig param='recovery_2nd_stage_command'} + {custom_tr_pgconfig param='recovery_timeout'} {if paramExists('client_idle_limit_in_recovery')} - - - -
client_idle_limit_in_recovery (integer) -
- + {custom_tr_pgconfig param='client_idle_limit_in_recovery'} {/if}
{$message.strParameter|escape}{$message.strValue|escape}
{if hasWatchdog()} - {* --------------------------------------------------------------------- * - * Watchdog * - * --------------------------------------------------------------------- *} -

Watchdog

+ {* ===================================================================== *} +

Watchdog

+ {* ===================================================================== *} - - - - - - - - - {* --------------------------------------------------------------------- *} - +
{$message.strParameter|escape}{$message.strValue|escape}
Enabling
+ {custom_table_pgconfig} - - - -
use_watchdog (bool) * -
- + + {custom_tr_pgconfig param='use_watchdog'} + - {* --------------------------------------------------------------------- *} - - - - - -
trusted_servers (string) * -
- - - - - -
ping_path (string) * -
- + + {* --------------------------------------------------------------------- *} + + {* --------------------------------------------------------------------- *} - {* --------------------------------------------------------------------- *} - - - - - -
wd_hostname (string) * -
- - - - - -
wd_port (integer) * -
- - - - - -
wd_authkey (string) * -
- + {custom_tr_pgconfig param='trusted_servers'} + {custom_tr_pgconfig param='ping_path'} + - {* --------------------------------------------------------------------- *} - - - - - -
delegate_IP (string) * -
- - - - - -
ifconfig_path (string) * -
- - - - - -
if_up_cmd (string) * -
- - - - - -
if_down_cmd (string) * -
- - - - - -
arping_path (string) * -
- - - - - -
arping_cmd (string) * -
- + + {* --------------------------------------------------------------------- *} + + {* --------------------------------------------------------------------- *} + + {custom_tr_pgconfig param='wd_hostname'} + {custom_tr_pgconfig param='wd_port'} + {if paramExists('wd_priority')} + {custom_tr_pgconfig param='wd_priority'} + {/if} + {custom_tr_pgconfig param='wd_authkey'} + {if paramExists('wd_ipc_socket_dir')} + {custom_tr_pgconfig param='wd_ipc_socket_dir'} + {/if} + - {* --------------------------------------------------------------------- *} - - - - - -
clear_memqcache_on_escalation (bool) -
- - - - - -
wd_escalation_command (string) * -
- + + {* --------------------------------------------------------------------- *} + + {* --------------------------------------------------------------------- *} + + {custom_tr_pgconfig param='delegate_IP'} + {if paramExists('ifconfig_path')} + {custom_tr_pgconfig param='ifconfig_path'} + {/if} + {if paramExists('if_cmd_path')} + {custom_tr_pgconfig param='if_cmd_path'} + {/if} + {custom_tr_pgconfig param='if_up_cmd'} + {custom_tr_pgconfig param='if_down_cmd'} + {custom_tr_pgconfig param='arping_path'} + {custom_tr_pgconfig param='arping_cmd'} + - {* --------------------------------------------------------------------- *} - - - {if paramExists('wd_lifecheck_method')} - - - -
wd_lifecheck_method (string) * -
- - {/if} + - - - -
wd_interval (integer) * -
- + {* --------------------------------------------------------------------- *} + + {* --------------------------------------------------------------------- *} - {* --------------------------------------------------------------------- *} - {if paramExists('heartbeat_destination')} - - - - - -
wd_heartbeat_port (integer) * -
- - - - - -
wd_heartbeat_keepalive (integer) * -
- - - - - -
wd_heartbeat_deadtime (integer) * -
- - - {if paramExists('heartbeat_destination')} - {foreach from=$params.heartbeat_destination key=dest_num item=v} - - + {custom_tr_pgconfig param='clear_memqcache_on_escalation'} + {custom_tr_pgconfig param='wd_escalation_command'} + {if paramExists('wd_de_escalation_command')} + {custom_tr_pgconfig param='wd_de_escalation_command'} + {/if} + - - -
heartbeat_destination{$dest_num|escape} (string) -
+ + {* --------------------------------------------------------------------- *} + + {* --------------------------------------------------------------------- *} - - + {if paramExists('wd_lifecheck_method')} + {custom_tr_pgconfig param='wd_lifecheck_method'} + {/if} + {custom_tr_pgconfig param='wd_interval'} + - - - -
heartbeat_destination_port{$dest_num} (integer) -
- + {if paramExists('wd_heartbeat_port')} + + {* --------------------------------------------------------------------- *} + + {* --------------------------------------------------------------------- *} + + {custom_tr_pgconfig param='wd_heartbeat_port'} + {custom_tr_pgconfig param='wd_heartbeat_keepalive'} + {custom_tr_pgconfig param='wd_heartbeat_deadtime'} + + + + {* --------------------------------------------------------------------- *} + + {* --------------------------------------------------------------------- *} + + {if paramExists('heartbeat_destination')} + {foreach from=$params.heartbeat_destination key=dest_num item=v} + + {custom_tr_pgconfig param='heartbeat_destination' num=$dest_num} + {custom_tr_pgconfig param='heartbeat_destination_port' num=$dest_num} + {custom_tr_pgconfig param='heartbeat_device' num=$dest_num} + {/foreach} + + {if isset($isAddHeartbeatDestination) && $isAddHeartbeatDestination == true} + + {custom_tr_pgconfig param='heartbeat_destination' num=$dest_num+1} + {custom_tr_pgconfig param='heartbeat_destination_port' num=$dest_num+1} + {custom_tr_pgconfig param='heartbeat_device' num=$dest_num+1} + {/if} + {/if} + + {/if} - - - -
heartbeat_device{$dest_num} (string) -
- - {/foreach} + + {* --------------------------------------------------------------------- *} + + {* --------------------------------------------------------------------- *} + + {custom_tr_pgconfig param='wd_life_point'} + {custom_tr_pgconfig param='wd_lifecheck_query'} + {if paramExists('wd_lifecheck_dbname')} + {custom_tr_pgconfig param='wd_lifecheck_dbname'} + {custom_tr_pgconfig param='wd_lifecheck_user'} + {custom_tr_pgconfig param='wd_lifecheck_password'} + {/if} + - {if isset($isAddHeartbeatDestination) && $isAddHeartbeatDestination == true} - - - - - + + {* --------------------------------------------------------------------- *} + + {* --------------------------------------------------------------------- *} + {foreach from=$params.other_pgpool_hostname key=host_num item=v} - - + + {custom_tr_pgconfig param='other_pgpool_hostname' num=$host_num} + {custom_tr_pgconfig param='other_pgpool_port' num=$host_num} + {custom_tr_pgconfig param='other_wd_port' num=$host_num} - - - - + {/foreach} - - - - {else} - - + {if isset($isAddWd) && $isAddWd == true} + + - {/if} - {/if} - {/if} - - {* --------------------------------------------------------------------- *} - - - - - -
wd_life_point(integer) * -
- - - - - -
wd_lifecheck_query (string) * -
- - - {if paramExists('wd_lifecheck_dbname')} - - - -
wd_lifecheck_dbname (string) * -
- - - - - -
wd_lifecheck_user (string) * -
- - - - - -
wd_lifecheck_password (string) * -
- - {/if} - - {* --------------------------------------------------------------------- *} - - - {foreach from=$params.other_pgpool_hostname key=host_num item=v} - - - - -
other_pgpool_hostname{$host_num} (string) -
- - - - - - -
other_pgpool_port{$host_num|escape} (integer) -
- - - - - -
other_wd_port{$host_num|escape} (integer) -
- - {/foreach} - - {if isset($isAddWd) && $isAddWd == true} - - - - - - - - - - - - - - - - {/if} - - - {if isset($isAddWd) && $isAddWd == true} - - - - - - {else} - - - - - - {/if} -
Connection to up stream servers
Connection to up stream servers
Watchdog communication Settings
Virtual IP control Setting
Watchdog communication Settings
Behavior on escalation Setting
Virtual IP control Setting
Lifecheck Setting (common)
-
Behavior on escalation Setting
Lifecheck Setting (heartbeat mode)
-
-
-
destination {$dest_num}
Lifecheck Setting (common)
-
Lifecheck Setting (heartbeat mode)
Heartbeat destinations + +
+ Heartbeat destination {$dest_num} +
+ Heartbeat destination {$dest_num+1} + +
Lifecheck Setting (query mode)
destination {$dest_num + 1} -
heartbeat_destination{$smarty.section.dest_num.index|escape} (string)
Other pgpool Connection Settings + +
-
heartbeat_destination_port{$smarty.section.dest_num.index|escape} (integer)
other pgpool {$host_num}
-
heartbeat_device{$smarty.section.dest_num.index} (string)
-
-
other pgpool {$host_num+1}
Lifecheck Setting (query mode)
-
Other pgpool Connection Settings
other {$host_num} -
other {$host_num + 1} -
other_pgpool_hostname{$smarty.section.num.index} (string)
-
other_pgpool_port{$smarty.section.num.index|escape} (integer)
-
other_wd_port{$smarty.section.num.index|escape} (integer)
-
-
+ {custom_tr_pgconfig param='other_pgpool_hostname' num=$host_num+1} + {custom_tr_pgconfig param='other_pgpool_port' num=$host_num+1} + {custom_tr_pgconfig param='other_wd_port' num=$host_num+1} + {/if} + + {/if} {if hasMemqcache()} - {* --------------------------------------------------------------------- * - * In Memory Query Cache * - * --------------------------------------------------------------------- *} -

In Memory Query Cache

+ {* ===================================================================== *} +

In Memory Query Cache

+ {* ===================================================================== *} - - - - - - - - - - - - - - - - -
memory_cache_enabled (bool) -
- - - - - -
memqcache_method (string) * -
- + {custom_table_pgconfig} - + + {custom_tr_pgconfig param='memory_cache_enabled'} + - - - -
memqcache_memcached_host (string) * -
- + + {custom_tr_pgconfig param='memqcache_method'} - - - -
memqcache_memcached_port (integer) * -
- + {* --------------------------------------------------------------------- *} + + {* --------------------------------------------------------------------- *} - + {custom_tr_pgconfig param='memqcache_expire'} + {custom_tr_pgconfig param='memqcache_auto_cache_invalidation'} + {custom_tr_pgconfig param='memqcache_maxcache'} + {custom_tr_pgconfig param='memqcache_oiddir'} + {custom_tr_pgconfig param='white_memqcache_table_list'} + {custom_tr_pgconfig param='black_memqcache_table_list'} + - - - -
memqcache_total_size (integer) * -
- - - - - -
memqcache_max_num_cache (integer) * -
- - - - - -
memqcache_cache_block_size (integer) * -
- + + {* --------------------------------------------------------------------- *} + + {* --------------------------------------------------------------------- *} - + {custom_tr_pgconfig param='memqcache_memcached_host'} + {custom_tr_pgconfig param='memqcache_memcached_port'} + - - - -
memqcache_expire (integer) * -
- - - - - -
memqcache_auto_cache_invalidation * -
- - - - - -
memqcache_maxcache (integer) * -
- - - - - -
memqcache_oiddir (string) * -
- - - - - -
white_memqcache_table_list (string) -
- - - - - -
black_memqcache_table_list (string) -
- + + {* --------------------------------------------------------------------- *} + + {* --------------------------------------------------------------------- *} - + {custom_tr_pgconfig param='memqcache_total_size'} + {custom_tr_pgconfig param='memqcache_max_num_cache'} + {custom_tr_pgconfig param='memqcache_cache_block_size'} +
{$message.strParameter|escape}{$message.strValue|escape}
Memcached specific
Common
Shared memory specific
Memcached specific
Common
Shared memory specific
{/if} {if paramExists('relcache_expire')} - {* --------------------------------------------------------------------- * - * Others * - * --------------------------------------------------------------------- *} -

Others

+ {* ===================================================================== *} +

Others

+ {* ===================================================================== *} - - - - - - - - - - - - - - - - -
relcache_expire (integer) -
- + {custom_table_pgconfig} + + {custom_tr_pgconfig param='relcache_expire'} {if paramExists('relcache_size')} - - - -
relcache_size (integer) -
- + {custom_tr_pgconfig param='relcache_size'} {/if} - {if paramExists('check_temp_table')} - - - -
check_temp_table (bool) -
- + {custom_tr_pgconfig param='check_temp_table'} + {/if} + {if paramExists('check_unlogged_table')} + {custom_tr_pgconfig param='check_unlogged_table'} {/if} -
{$message.strParameter|escape}{$message.strValue|escape}
{/if} @@ -1893,8 +747,8 @@ function delHeartbeatDestination(num){ * --------------------------------------------------------------------- *}

- - + +

diff --git a/version.php b/version.php index c88afb1..786e248 100644 --- a/version.php +++ b/version.php @@ -23,6 +23,6 @@ * @version SVN: $Id$ */ -$version = '3.4.1'; +$version = '3.5.0'; ?> -- 2.39.5