Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1583021

Summary: Updating postgresql.conf fails to parse existing values with units
Product: [oVirt] ovirt-engine Reporter: Yedidyah Bar David <didi>
Component: Setup.EngineCommonAssignee: Yedidyah Bar David <didi>
Status: CLOSED WONTFIX QA Contact: Pavel Stehlik <pstehlik>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.2.3CC: bugs, ylavi
Target Milestone: ---Flags: sbonazzo: ovirt-4.3-
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: 2018-07-02 07:40:51 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:
Attachments:
Description Flags
setup log none

Description Yedidyah Bar David 2018-05-28 06:10:05 UTC
Description of problem:

When checking validity of existing conf, we either use 'show $KEY' (for most keys), or 'select setting from pg_settings' - latter we do for keys where we do not want "pretty" formatting that includes units, but raw numbers.

But when updating the file, we do not do any of this - we just read it. The code doing that does not try to parse units, thus fails if any are in use and the function checking them expects a raw number.

Not sure we can use 'select ' at this point to fix this. Perhaps we should simply parse the value ourselves, either in getUpdatedPGConf or in the individual checker functions per each key.

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

4.2, probably 4.1 too

How reproducible:

Always

Steps to Reproduce:
1. install engine
2. init pg, edit postgresql.conf to have 'work_mem = 8MB', restart it
3. engine-setup, choose automatic provisioning

Actual results:

Fails with:

[ ERROR ] Failed to execute stage 'Misc configuration': invalid literal for int() with base 10: '8MB'

Expected results:

Succeeds

Additional info:

Tested only with work_mem, but please fix for all relevant keys.

Comment 1 Yedidyah Bar David 2018-05-28 06:11:04 UTC
Workaround: Edit the file to not include units, e.g. 'work_mem = 8192'.

Comment 2 Yedidyah Bar David 2018-05-28 07:22:54 UTC
Created attachment 1442743 [details]
setup log

Comment 3 Yaniv Lavi 2018-07-02 07:40:51 UTC
Closing old bugs.
Please reopen if still relevant.
In any case patches are welcomed.