Description of problem: By upgrading engine engine-setup asks to change postgres configuration defaults. If there is MB or kB in value for maintenance_work_mem, engine-setup fails. Version-Release number of selected component (if applicable): ovirt-engine-4.1.2-0.1.el7.noarch How reproducible: always Steps to Reproduce: 1. set in /var/lib/pgsql/data/postgresql.conf maintenance_work_mem = 16MB on engine database and restart postgres 2. upgrade engine to 4.1.2 3. engine-setup shows that maintenance_work_mem in postgres.conf should be changed, let it correct the value Actual results: engine-setup ends with error [ ERROR ] Failed to execute stage 'Misc configuration': invalid literal for int() with base 10: '16MB' Expected results: no error, values in postgresql.conf are changed Additional info: setup log 2017-05-02 16:22:49 DEBUG otopi.context context._executeMethod:142 method exception Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/otopi/context.py", line 132, in _executeMethod method['method']() File "/usr/share/ovirt-engine/setup/bin/../plugins/ovirt-engine-setup/ovirt-engine/db/configuration.py", line 222, in _updatePGConf transaction=localtransaction, File "/usr/share/ovirt-engine/setup/ovirt_engine_setup/engine_common/postgres.py", line 284, in _updatePostgresConf needUpdate, content = dbovirtutils.getUpdatedPGConf(content) File "/usr/share/ovirt-engine/setup/ovirt_engine_setup/engine_common/database.py", line 1004, in getUpdatedPGConf expected=item['expected'] File "/usr/share/ovirt-engine/setup/bin/../plugins/ovirt-engine-setup/ovirt-engine/db/configuration.py", line 128, in <lambda> int(current) >= int(expected) ValueError: invalid literal for int() with base 10: '16MB'
Roy, can you look at this? I'm mostly interested in what happens with PG 9.5
9.5 Officially supports string memory units - https://www.postgresql.org/docs/9.5/static/config-setting.html. Is 9.5 for 4.2 is done? if yes I'll close currentrelease.
(In reply to Roy Golan from comment #2) > 9.5 Officially supports string memory units - > https://www.postgresql.org/docs/9.5/static/config-setting.html. > > Is 9.5 for 4.2 is done? if yes I'll close currentrelease. Almost - https://gerrit.ovirt.org/#/q/topic:postgres9.5
Moving to ON_QA based on the above.
I got this working for both 9.2 and 9.5 The problem is that the setup plugin for some reason gets "16MB" instead of 16384 The code here, which was there from the start is making sure to it always gets the the value through a sql query on pg_settings table: https://github.com/oVirt/ovirt-engine/blob/37c2a5ad06351c804bf8c5549610bd3c1e2ead26/packaging/setup/ovirt_engine_setup/engine_common/database.py#L1049 Verification on 9.5 and 9.2 using psql: ovirt=# select setting maintenance_work_mem from pg_settings where name = 'maintenance_work_mem'; maintenance_work_mem ---------------------- 16384 (1 row) ovirt=# show maintenance_work_mem ; maintenance_work_mem ---------------------- 16MB (1 row)
It doesn't work (even when upgrading engine 4.2 to newest 4.2 version or only runing engine-setup with no new packages). engine-setup still ends with failure by fixing automatically. Steps to reproduce for ovirt 4.2: 1. change in /var/opt/rh/rh-postgresql95/lib/pgsql/data/postgresql.conf maintenance_work_mem = 16MB 2. restart service systemctl restart rh-postgresql95-postgresql 3. run engine-setup 4. on 'Fix automaticaly?' say yes
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release.
Created attachment 1342144 [details] setup log
We didn't get to this bug for more than 2 years, and it's not being considered for the upcoming 4.4. It's unlikely that it will ever be addressed so I'm suggesting to close it. If you feel this needs to be addressed and want to work on it please remove cond nack and target accordingly.
Closing old bug. Please reopen if still relevant/you want to work on it.