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:33:40 +0000 (13:33 +0900)
commit28d3955cac59ac3ae5f1e939b5a9fc97021ec54f
tree20fe4b5b1be5bc9b6765e574d8ff495b79821290
parent45ea99173a0f1fdaff0d0099bf621db89a085f18
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