Bug 1968146

Summary: PostgreSQL provisioning fails to parse values with units
Product: [oVirt] ovirt-engine Reporter: Yedidyah Bar David <didi>
Component: Setup.EngineCommonAssignee: Nobody <nobody>
Status: CLOSED DEFERRED QA Contact: meital avital <mavital>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.4.5CC: bugs
Target Milestone: ---Flags: sbonazzo: ovirt-4.5-
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-04 08:12:31 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 2021-06-06 05:49:14 UTC
Description of problem:

When provisioning PostgreSQL, we also check some values in its configuration, so that we can change them if needed.

The code used there is not parsing unit values, if present, failing engine-setup.

Version-Release number of selected component (if applicable):
"Forever" (probably since at least 3.5 or so).

How reproducible:
Always, I think

Steps to Reproduce:
1. Create/edit postgresql.conf with 'work_mem = 8MB'
2. Install ovirt-engine
3. Run engine-setup

Actual results:
Fails with something like [1]:

ValueError: invalid literal for int() with base 10: '8MB'

[1] https://lists.ovirt.org/archives/list/devel@ovirt.org/thread/MX3T5WR6TQMALRE3O767K2FQE222AMWM/

Expected results:
Succeeds

Additional info:
This happens only during provisioning of a new database, which is usually during initial setup of a new engine/dwh machine. Normally, people do not configure postgresql.conf before engine-setup, but rely on engine-setup to do this, which is why we didn't run into this bug so far.

We have similar, but different code, for checking existing values during upgrade. On upgrade, we already have a DB up, and query it, instead of parsing its conf. This was done for bug 1388433.

In EL8, postgresql.conf is in /var/lib/pgsql/data .
If you want it to be created for you before step 1, so that you only need to edit a single value for reproduction/verification, you can run 'postgresql-setup --initdb'.

Comment 1 Sandro Bonazzola 2022-05-04 08:12:31 UTC
Didn't got time to work on this in a year, closing deferred due to capacity.
We may consider reopening if we'll have capacity.