Bug 1447624 - units in values causes error by changing auto-vacuum configuration defaults
Summary: units in values causes error by changing auto-vacuum configuration defaults
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: Database.Core
Version: 4.1.2
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Martin Perina
QA Contact: Lucie Leistnerova
URL:
Whiteboard:
Depends On: 1388433
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-05-03 10:58 UTC by Lucie Leistnerova
Modified: 2020-06-26 16:37 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2020-04-01 14:46:57 UTC
oVirt Team: Infra
Embargoed:
mperina: ovirt-4.5?


Attachments (Terms of Use)
setup log (647.45 KB, text/plain)
2017-10-23 12:18 UTC, Lucie Leistnerova
no flags Details

Description Lucie Leistnerova 2017-05-03 10:58:57 UTC
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'

Comment 1 Yaniv Kaul 2017-09-04 18:56:31 UTC
Roy, can you look at this? I'm mostly interested in what happens with PG 9.5

Comment 2 Roy Golan 2017-09-05 08:16:59 UTC
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.

Comment 3 Yaniv Kaul 2017-09-05 08:48:50 UTC
(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

Comment 4 Oved Ourfali 2017-09-27 09:09:53 UTC
Moving to ON_QA based on the above.

Comment 5 Roy Golan 2017-10-18 12:27:47 UTC
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)

Comment 6 Lucie Leistnerova 2017-10-23 12:18:11 UTC
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

Comment 7 Red Hat Bugzilla Rules Engine 2017-10-23 12:18:16 UTC
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.

Comment 8 Lucie Leistnerova 2017-10-23 12:18:47 UTC
Created attachment 1342144 [details]
setup log

Comment 9 Michal Skrivanek 2020-03-19 15:41:01 UTC
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.

Comment 10 Michal Skrivanek 2020-04-01 14:46:57 UTC
Closing old bug. Please reopen if still relevant/you want to work on it.


Note You need to log in before you can comment on or make changes to this bug.