Bug 1770646

Summary: log_rotation_size must be set when enabling log_min_duration_statement for PostgreSQL
Product: Red Hat Satellite Reporter: matt jia <mjia>
Component: InstallationAssignee: Ewoud Kohl van Wijngaarden <ekohlvan>
Status: CLOSED ERRATA QA Contact: Devendra Singh <desingh>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.6.0CC: ehelms, mmccune, sthirugn, zhunting
Target Milestone: 6.7.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: foreman-installer-1.24.1.6-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-14 13:26:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description matt jia 2019-11-11 02:48:34 UTC
Description of problem:

BZ#1749233 is going to set log_min_duration_statement=1000 for PostgreSQL by default. However, this has a possible side effect on a large deployment where  /var/lib/pgsql is mounted separately. The /var/lib/pgsql can be easily filled up
when slow queries are identified. For example, a slow query for selecting facts could consume a large space when there are many facts on a host.

Expected results:

A reasonable log_rotation_size should be set to prevent /var/lib/pgsql being filled up.

Comment 3 sthirugn@redhat.com 2019-12-12 16:36:40 UTC
As per the email discussion, log_rotation_size of 200MB will be implemented to resolve this issue:

log_rotation_size: 200000

Comment 4 sthirugn@redhat.com 2019-12-12 17:48:37 UTC
Created redmine issue https://projects.theforeman.org/issues/28497 from this bug

Comment 5 Bryan Kearney 2019-12-13 23:03:29 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/28497 has been resolved.

Comment 9 Devendra Singh 2020-02-14 10:08:12 UTC
Verified on 6.7 Snap11.

#rpm -q foreman-installer
foreman-installer-1.24.1.6-1.el7sat.noarch

#cat /usr/share/foreman-installer/config/foreman.hiera/tuning/common.yaml 

---
lookup_options:
  postgresql::server::config_entries:
    merge: hash

apache::mod::passenger::passenger_max_pool_size: 12
apache::mod::passenger::passenger_max_instances_per_app: 6
apache::mod::passenger::passenger_max_request_queue_size: 250
apache::mod::passenger::passenger_stat_throttle_rate: 120
apache::mod::passenger::passenger_max_requests: 10000
apache::mod::passenger::passenger_min_instances: 1
apache::mod::passenger::passenger_max_preloader_idle_time: 0

qpid::open_file_limit: 65536
qpid::router::open_file_limit: 150100

postgresql::server::config_entries:
  checkpoint_completion_target: 0.9
  max_connections: 500
  shared_buffers: 512MB
  work_mem: 4MB
  log_line_prefix: '%t '
  log_min_duration_statement: 1000
  log_rotation_size: 200000

Comment 12 errata-xmlrpc 2020-04-14 13:26:24 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:1454