Bug 1578276

Summary: [engine-setup] PostgreSQL conf verification text is broken
Product: [oVirt] ovirt-engine Reporter: Yedidyah Bar David <didi>
Component: Setup.EngineCommonAssignee: Yedidyah Bar David <didi>
Status: CLOSED CURRENTRELEASE QA Contact: Lucie Leistnerova <lleistne>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.2.3CC: amureini, bugs, eheftman, lsvaty, rgolan
Target Milestone: ovirt-4.2.4Flags: rule-engine: ovirt-4.2+
rule-engine: exception+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-engine-4.2.4 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-06-26 08:36:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Integration RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Yedidyah Bar David 2018-05-15 07:36:30 UTC
Description of problem:

If engine-setup finds problems with PG's configuration, it emits something like this:

[ ERROR ] Please set:
          autovacuum_vacuum_scale_factor = 0.01
          autovacuum_analyze_scale_factor = 0.075
          autovacuum_max_workers = 6
          work_mem = 8192
          server_version = 9.5.9
         in postgresql.conf on 'None'. Its location is usually /var/lib/pgsql/data , or somewhere under /etc/postgresql* .

This is broken in two ways:

1. You can't set server_version, you have to upgrade (client or server).

2. Some parameters can have larger (or smaller) values than suggested. The tests do work then, but the text does not show this.

We had code to show more specific text, but it was accidentally broken since 4.1.2, with the changes for bug 1388433.

Version-Release number of selected component (if applicable):

4.1.2 and later

How reproducible:

Always

Steps to Reproduce:
1. Try to setup an engine with a remote database with a different version and incompatible parameters (e.g. max_connections=100).
2.
3.

Actual results:

See above.

Expected results:

I think we should separate the message to two parts:

1. Things to be changed in the configuration file

These can be combined to a single text like now. Not sure how best to show the text.

2. Other things

Should have their own text, unrelated to the configuration file.

Additional info:

Comment 1 Yedidyah Bar David 2018-05-15 07:38:14 UTC
Output with the current preliminary version of the linked patch 91219 is:

          Engine database host [localhost]: engine958
          Engine database port [5432]:
          Engine database secured connection (Yes, No) [No]:
          Engine database name [engine]: engine958
          Engine database user [engine]: engine958
          Engine database password:

 [ ERROR ] Please set:
          autovacuum_vacuum_scale_factor = 0.01 ; autovacuum_vacuum_scale_factor required to be at most 0.01
          autovacuum_analyze_scale_factor = 0.075 ; autovacuum_analyze_scale_factor required to be at most 0.075
          autovacuum_max_workers = 6 ; autovacuum_max_workers required to be at least 6
          work_mem = 8192 ; work_mem required to be at least 8192
          max_connections = 150 ; max_connections required to be at least 150
          lc_messages = 'en_US.UTF-8' ; Engine requires lc_messages to be 'en_US.UTF-8'. 
          server_version = 9.5.9 ; Postgresql client version is '9.5.9', whereas the version on engine958 is '9.5.8'. Please use a Postgresql server of version '9.5.9'.
         in postgresql.conf on 'engine958'. Its location is usually /var/lib/pgsql/data , or somewhere under /etc/postgresql* .

Emma - what do you think? How would you prefer to present it? Thanks.

Comment 2 Yedidyah Bar David 2018-05-15 08:23:43 UTC
(In reply to Yedidyah Bar David from comment #0)
>          in postgresql.conf on 'None'. Its location is usually

Also "'None'" should be fixed.

Comment 3 Yedidyah Bar David 2018-05-15 08:25:18 UTC
Emma - please ignore comment 1. I updated the patch. Current output is:

          Engine database host [localhost]: engine958
          Engine database port [5432]: 
          Engine database secured connection (Yes, No) [No]: 
          Engine database name [engine]: engine958
          Engine database user [engine]: engine958
          Engine database password: 
[ ERROR ] Postgresql client version is '9.5.9', whereas the version on 'engine958' is '9.5.8'. Please use a PostgreSQL server of version '9.5.9'.
         Please note the following required changes in postgresql.conf on 'engine958':
           'autovacuum_vacuum_scale_factor' is currently '0.2'. It is required to be at most '0.01'.
           'autovacuum_analyze_scale_factor' is currently '0.1'. It is required to be at most '0.075'.
           'autovacuum_max_workers' is currently '3'. It is required to be at least '6'.
           'work_mem' is currently '4096'. It is required to be at least '8192'.
           'max_connections' is currently '100'. It is required to be at least '150'.
           'lc_messages' is currently 'de_DE.UTF-8'. Engine requires lc_messages to be 'en_US.UTF-8'. .
         postgresql.conf is usually in /var/lib/pgsql/data, /var/opt/rh/rh-postgresql95/lib/pgsql/data, or somewhere under /etc/postgresql* . You have to restart PostgreSQL after making these changes.

Comments/suggestions are welcome.

Comment 4 Emma Heftman 2018-05-21 10:37:28 UTC
(In reply to Yedidyah Bar David from comment #3)
> Emma - please ignore comment 1. I updated the patch. Current output is:
> 
>           Engine database host [localhost]: engine958
>           Engine database port [5432]: 
>           Engine database secured connection (Yes, No) [No]: 
>           Engine database name [engine]: engine958
>           Engine database user [engine]: engine958
>           Engine database password: 
> [ ERROR ] Postgresql client version is '9.5.9', whereas the version on
> 'engine958' is '9.5.8'. Please use a PostgreSQL server of version '9.5.9'.
>          Please note the following required changes in postgresql.conf on
> 'engine958':
>            'autovacuum_vacuum_scale_factor' is currently '0.2'. It is
> required to be at most '0.01'.
>            'autovacuum_analyze_scale_factor' is currently '0.1'. It is
> required to be at most '0.075'.
>            'autovacuum_max_workers' is currently '3'. It is required to be
> at least '6'.
>            'work_mem' is currently '4096'. It is required to be at least
> '8192'.
>            'max_connections' is currently '100'. It is required to be at
> least '150'.
>            'lc_messages' is currently 'de_DE.UTF-8'. Engine requires
> lc_messages to be 'en_US.UTF-8'. .
>          postgresql.conf is usually in /var/lib/pgsql/data,
> /var/opt/rh/rh-postgresql95/lib/pgsql/data, or somewhere under
> /etc/postgresql* . You have to restart PostgreSQL after making these changes.
> 
> Comments/suggestions are welcome.

Hi Didi
Please change to:
The maximum allowed value is xxx....
The minimum allowed value is xxx

Comment 5 Lucie Leistnerova 2018-06-06 07:37:41 UTC
engine-setup postgres configuration output is like in Comment 3 and that seems alright.
Postgres version error shows only when X.Y version differs.

Changes that Emma suggested will not be implemented yet. If they are necessary, please open another BZ.

verified in ovirt-engine-setup-4.2.4.1-0.1.el7.noarch

Comment 6 Yedidyah Bar David 2018-06-25 08:05:56 UTC
*** Bug 1543329 has been marked as a duplicate of this bug. ***

Comment 7 Sandro Bonazzola 2018-06-26 08:36:59 UTC
This bugzilla is included in oVirt 4.2.4 release, published on June 26th 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.4 release, it has been closed with a resolution of CURRENT RELEASE.

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