pgpool2.git / summary / log / commit / refs

commit    097d93e4abe54bbc68c372f05e3466f62ce8d304
Author:   Tatsuo Ishii <ishii@sraoss.co.jp>
Date:     Thu Jun 03 05:39:06 2021 +0000

    Fix backend_application_name cannot be changed by reloading.
    
    The manual explicitly stats that it is possible to change
    backend_application_name on the fly by reloading the configuration
    file but the code set unnecessary restriction on that.


src/config/pool_config_variables.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/src/config/pool_config_variables.c b/src/config/pool_config_variables.c index cd42b1f45..dcaa46d19 100644 --- a/src/config/pool_config_variables.c +++ b/src/config/pool_config_variables.c @@ -4120,21 +4120,11 @@ BackendFlagsAssignFunc(ConfigContext context, char *newval, int index, int eleve static bool BackendAppNameAssignFunc(ConfigContext context, char *newval, int index, int elevel) { - BACKEND_STATUS backend_status = g_pool_config.backend_desc->backend_info[index].backend_status; - - if (context <= CFGCXT_INIT || backend_status == CON_UNUSED || backend_status == CON_DOWN) - { - if (newval == NULL || strlen(newval) == 0) - g_pool_config.backend_desc->backend_info[index].backend_application_name[0] = '\0'; - else - strlcpy(g_pool_config.backend_desc->backend_info[index].backend_application_name, newval, NAMEDATALEN - 1); - return true; - } - /* silent the warning in reload contxt */ - if (context != CFGCXT_RELOAD) - ereport(WARNING, - (errmsg("backend_application_name%d cannot be changed in context %d and backend status = %d", index, context, backend_status))); - return false; + if (newval == NULL || strlen(newval) == 0) + g_pool_config.backend_desc->backend_info[index].backend_application_name[0] = '\0'; + else + strlcpy(g_pool_config.backend_desc->backend_info[index].backend_application_name, newval, NAMEDATALEN - 1); + return true; } static bool [parent: b23b0290deb6]