postgresql icon indicating copy to clipboard operation
postgresql copied to clipboard

log_replication_commands parameter missing from v9.5, and v9.6

Open gclough opened this issue 6 years ago • 6 comments

The log_replication_commands parameter is missing from the v9.5, and v9.6 configuration. It should be added to the templates/postgresql.conf.9.[56].j2 files, and unless PR #267 is merged... then it should be added to the defaults/main.yml too.

gclough avatar Mar 23 '18 16:03 gclough

The gin_pending_list_limit is also missing from v9.5 and v9.6.

gclough avatar Mar 23 '18 16:03 gclough

I did some crosschecking using this script:

#!/bin/bash -

TEMPFILE=/tmp/`basename $0`.$$

for FILE in postgresql.conf-[0-9]*\.orig; do
  BASE_FILE="`echo $FILE | sed s/\.orig\$//`"
  cat ${BASE_FILE}.orig | sed s/\#// | grep ^[a-z] | cut -f1 -d' ' | sort | uniq > ${TEMPFILE}.orig
  cat ${BASE_FILE}.j2   | sed s/\#// | grep ^[a-z] | cut -f1 -d' ' | sort | uniq > ${TEMPFILE}.j2
  echo ================================================================================
  echo $BASE_FILE
  diff ${TEMPFILE}.orig ${TEMPFILE}.j2
  echo ================================================================================
  echo
done

And there are a couple of others missing from v9.5 and v9.6:

================================================================================
postgresql.conf-9.1
================================================================================

================================================================================
postgresql.conf-9.2
================================================================================

================================================================================
postgresql.conf-9.3
================================================================================

================================================================================
postgresql.conf-9.4
================================================================================

================================================================================
postgresql.conf-9.5
31d30
< cluster_name
148d146
< operator_precedence_warning
================================================================================

================================================================================
postgresql.conf-9.6
34d33
< cluster_name
156d154
< operator_precedence_warning
================================================================================

gclough avatar Mar 24 '18 14:03 gclough

I crosschecked them with the defaults/main.yml... and we're missing some in there too:

SCRIPT

#!/bin/bash -

#
# Identify a unique filename
#
TEMP_FILE=/tmp/`basename $0`.$$

#
# Loop through all postgresql.conf.orig files, and compare them to the j2 files
#
for FILE in postgresql.conf-[0-9]*\.orig; do
  #
  # Extract the base filename, removing ".orig"
  #
  BASE_FILE="`echo $FILE | sed s/\.orig\$//`"

  #
  # If we crash, then cleanup
  #
  trap 'rm -f ${TEMP_FILE}.orig ${TEMP_FILE}.j2 ${TEMP_FILE}.defaults' 0

  #
  # Extract a unique, sorted list of the parameter names
  #
  cat ${BASE_FILE}.orig | sed s/\#// | grep ^[a-z] | cut -f1 -d' ' | sort | uniq > ${TEMP_FILE}.orig
  cat ${BASE_FILE}.j2   | sed s/\#// | grep ^[a-z] | cut -f1 -d' ' | sort | uniq > ${TEMP_FILE}.j2
  cat ../defaults/main.yml | sed s/\#// | grep ^[a-z] | cut -f1 -d':' | sed s/^postgresql_// | sort | uniq > ${TEMP_FILE}.defaults

  #
  # Output a comparision
  #
  echo ================================================================================
  echo ${BASE_FILE}.orig ${BASE_FILE}.j2
  diff ${TEMP_FILE}.orig ${TEMP_FILE}.j2 && echo All parameters exist in both files
  echo --------------------------------------------------------------------------------
  echo ${BASE_FILE}.defaults ${BASE_FILE}.j2
  cat ${TEMP_FILE}.j2 | while read PARAM; do
    grep ^postgresql_${PARAM}: ../defaults/main.yml > /dev/null 2>&1 || echo "Missing $PARAM in ../defaults/main.yml"
  done
  echo ================================================================================
  echo

  #
  # Cleanup
  #
  rm -f ${TEMP_FILE}.orig ${TEMP_FILE}.j2 ${TEMP_FILE}.defaults
done

RESULT

[ansible@localhost templates]$ ./crosscheck_parameters.sh 
================================================================================
postgresql.conf-9.1.orig postgresql.conf-9.1.j2
All parameters exist in both files
--------------------------------------------------------------------------------
postgresql.conf-9.1.defaults postgresql.conf-9.1.j2
Missing custom_variable_classes in ../defaults/main.yml
Missing silent_mode in ../defaults/main.yml
================================================================================

================================================================================
postgresql.conf-9.2.orig postgresql.conf-9.2.j2
All parameters exist in both files
--------------------------------------------------------------------------------
postgresql.conf-9.2.defaults postgresql.conf-9.2.j2
================================================================================

================================================================================
postgresql.conf-9.3.orig postgresql.conf-9.3.j2
All parameters exist in both files
--------------------------------------------------------------------------------
postgresql.conf-9.3.defaults postgresql.conf-9.3.j2
Missing include in ../defaults/main.yml
Missing include_dir in ../defaults/main.yml
Missing include_if_exists in ../defaults/main.yml
================================================================================

================================================================================
postgresql.conf-9.4.orig postgresql.conf-9.4.j2
All parameters exist in both files
--------------------------------------------------------------------------------
postgresql.conf-9.4.defaults postgresql.conf-9.4.j2
Missing include in ../defaults/main.yml
Missing include_dir in ../defaults/main.yml
Missing include_if_exists in ../defaults/main.yml
================================================================================

================================================================================
postgresql.conf-9.5.orig postgresql.conf-9.5.j2
All parameters exist in both files
--------------------------------------------------------------------------------
postgresql.conf-9.5.defaults postgresql.conf-9.5.j2
Missing gin_pending_list_limit in ../defaults/main.yml
Missing include in ../defaults/main.yml
Missing include_dir in ../defaults/main.yml
Missing include_if_exists in ../defaults/main.yml
Missing operator_precedence_warning in ../defaults/main.yml
================================================================================

================================================================================
postgresql.conf-9.6.orig postgresql.conf-9.6.j2
All parameters exist in both files
--------------------------------------------------------------------------------
postgresql.conf-9.6.defaults postgresql.conf-9.6.j2
Missing gin_pending_list_limit in ../defaults/main.yml
Missing include in ../defaults/main.yml
Missing include_dir in ../defaults/main.yml
Missing include_if_exists in ../defaults/main.yml
Missing operator_precedence_warning in ../defaults/main.yml
================================================================================

gclough avatar Mar 24 '18 15:03 gclough

I've added these all to the parameter and default files:

[ansible@localhost templates]$ ./crosscheck_parameters.sh 
================================================================================
postgresql.conf-9.1.orig postgresql.conf-9.1.j2
All parameters exist in both files
--------------------------------------------------------------------------------
postgresql.conf-9.1.defaults postgresql.conf-9.1.j2
Missing silent_mode in ../defaults/main.yml
================================================================================

================================================================================
postgresql.conf-9.2.orig postgresql.conf-9.2.j2
All parameters exist in both files
--------------------------------------------------------------------------------
postgresql.conf-9.2.defaults postgresql.conf-9.2.j2
================================================================================

================================================================================
postgresql.conf-9.3.orig postgresql.conf-9.3.j2
All parameters exist in both files
--------------------------------------------------------------------------------
postgresql.conf-9.3.defaults postgresql.conf-9.3.j2
================================================================================

================================================================================
postgresql.conf-9.4.orig postgresql.conf-9.4.j2
All parameters exist in both files
--------------------------------------------------------------------------------
postgresql.conf-9.4.defaults postgresql.conf-9.4.j2
================================================================================

================================================================================
postgresql.conf-9.5.orig postgresql.conf-9.5.j2
All parameters exist in both files
--------------------------------------------------------------------------------
postgresql.conf-9.5.defaults postgresql.conf-9.5.j2
================================================================================

================================================================================
postgresql.conf-9.6.orig postgresql.conf-9.6.j2
All parameters exist in both files
--------------------------------------------------------------------------------
postgresql.conf-9.6.defaults postgresql.conf-9.6.j2
================================================================================

gclough avatar Mar 24 '18 15:03 gclough

Plenty of others that need fixing too!

gclough avatar Mar 09 '19 13:03 gclough

Almost done:

[gclough@localhost templates (test)]$ for FILE in postgresql.conf-[0-9]*\.orig; do
>   BASE_FILE="`echo $FILE | sed s/\.orig\$//`"
>   cat ${BASE_FILE}.orig | sed s/\#// | grep ^[a-z] | cut -f1 -d' ' | sort | uniq > ${TEMPFILE}.orig
>   cat ${BASE_FILE}.j2   | sed s/\#// | grep ^[a-z] | cut -f1 -d' ' | sort | uniq > ${TEMPFILE}.j2
>   echo ================================================================================
>   echo $BASE_FILE
>   diff ${TEMPFILE}.orig ${TEMPFILE}.j2
>   echo ================================================================================
>   echo
> done
================================================================================
postgresql.conf-10
96d95
< include
98d96
< include_if_exists
================================================================================

================================================================================
postgresql.conf-11
102d101
< include
104d102
< include_if_exists
================================================================================

================================================================================
postgresql.conf-9.1
================================================================================

================================================================================
postgresql.conf-9.2
================================================================================

================================================================================
postgresql.conf-9.3
================================================================================

================================================================================
postgresql.conf-9.4
89d88
< include
91d89
< include_if_exists
================================================================================

================================================================================
postgresql.conf-9.5
84,85d83
< gin_fuzzy_search_limit
< gin_pending_list_limit
91d88
< include
93d89
< include_if_exists
================================================================================

================================================================================
postgresql.conf-9.6
88,89d87
< gin_fuzzy_search_limit
< gin_pending_list_limit
96d93
< include
98d94
< include_if_exists
================================================================================

gclough avatar Mar 09 '19 23:03 gclough

v9.5 and v9.6 are not longer supported, and log_replication_commands is already included in later versions.

gclough avatar Mar 14 '24 10:03 gclough