Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
gclough opened this issue Mar 23, 2018 · 7 comments
Closed

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

gclough opened this issue Mar 23, 2018 · 7 comments

Comments

@gclough
Copy link
Collaborator

gclough commented Mar 23, 2018

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
Copy link
Collaborator Author

gclough commented Mar 23, 2018

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

@gclough
Copy link
Collaborator Author

gclough commented Mar 24, 2018

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
Copy link
Collaborator Author

gclough commented Mar 24, 2018

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
Copy link
Collaborator Author

gclough commented Mar 24, 2018

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
Copy link
Collaborator Author

gclough commented Mar 9, 2019

Plenty of others that need fixing too!

@gclough gclough reopened this Mar 9, 2019
@gclough
Copy link
Collaborator Author

gclough commented Mar 9, 2019

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
Copy link
Collaborator Author

gclough commented Mar 14, 2024

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

@gclough gclough closed this as completed Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant