Fix backend_flag* parameter shown twice while executing "pgpool show all".
authorTatsuo Ishii <ishii@sraoss.co.jp>
Sun, 8 Aug 2021 04:19:33 +0000 (13:19 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Sun, 8 Aug 2021 04:25:29 +0000 (13:25 +0900)
commit491bb25dcd3123acfb8d88a9e732d7c36cc57df1
treeca18933eb03d8b0aa1bb3a58ec8790463b8f2422
parenta74103f9b725eda99392da0cc0033077eb35e5b9
Fix backend_flag* parameter shown twice while executing "pgpool show all".

There are two entries of "backend_flag" for "ALLOW_TO_FAILOVER" and
"ALWAYS_PRIMARY" in the config variable struct. This is mostly ok but
"pgpool show all" command displayed both backend_flag entries, which
looks redundant. The reason for this is, report_all_variables() shows
grouped variables first then other variables except already shown as
grouped variables.  Unfortunately build_variable groups() is not smart
enough to build grouped variable data: it only registers the first
backend_flag entry and leaves the second entry. Since the second entry
is not a grouped variable, backend_flag is shown firstly as a grouped
variable and then is show as a non grouped variable in
report_all_variables(). To fix this, mark that the second variable is
also a grouped variable (the flag is set by
build_config_variables()). See bug 728 for the report of the problem.

Also add/fix comments.
src/config/pool_config_variables.c