Bug 1839076

Summary: engine-vacuum on nonexistent table returns 0
Product: [oVirt] ovirt-engine Reporter: Petr Matyáš <pmatyas>
Component: GeneralAssignee: Eli Mesika <emesika>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Matyáš <pmatyas>
Severity: low Docs Contact:
Priority: unspecified    
Version: 4.4.1CC: bugs, didi, mperina
Target Milestone: ovirt-4.4.1Flags: pm-rhel: ovirt-4.4+
Target Release: 4.4.1.4   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-engine-4.4.1.4 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-07-08 08:27:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Petr Matyáš 2020-05-22 12:48:15 UTC
Description of problem:
When running engine-vacuum on nonexistent table return code is 0, should be non-zero.

Version-Release number of selected component (if applicable):
ovirt-engine-4.4.1-0.1.el8ev.noarch

How reproducible:
always

Steps to Reproduce:
1. engine-vacuum -t test
2.
3.

Actual results:
shows error but returns 0

Expected results:
shows error and returns non-zero return code

Additional info:
[root@engine ~]# engine-vacuum -t test
vacuumdb: vacuuming database "engine"
vacuumdb: error: query failed: ERROR:  relation "test" does not exist
LINE 2:   VALUES ('test'::pg_catalog.regclass, NULL::pg_catalog.text...
                  ^
vacuumdb: query was: WITH listed_tables (table_oid, column_list) AS (
  VALUES ('test'::pg_catalog.regclass, NULL::pg_catalog.text)
)
SELECT c.relname, ns.nspname, listed_tables.column_list FROM pg_catalog.pg_class c
 JOIN pg_catalog.pg_namespace ns ON c.relnamespace OPERATOR(pg_catalog.=) ns.oid
 LEFT JOIN pg_catalog.pg_class t ON c.reltoastrelid OPERATOR(pg_catalog.=) t.oid
 JOIN listed_tables ON listed_tables.table_oid OPERATOR(pg_catalog.=) c.oid
 ORDER BY c.relpages DESC;
/usr/bin/engine-vacuum: line 85: ==1: command not found
[root@engine ~]# echo $?
0

Comment 1 Yedidyah Bar David 2020-06-15 08:15:56 UTC
Seems like it's still broken

Comment 2 RHEL Program Management 2020-06-15 08:16:03 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 3 Petr Matyáš 2020-06-25 12:14:27 UTC
Verified on ovirt-engine-4.4.1.5-0.17.el8ev.noarch

Comment 4 Sandro Bonazzola 2020-07-08 08:27:40 UTC
This bugzilla is included in oVirt 4.4.1 release, published on July 8th 2020.

Since the problem described in this bug report should be resolved in oVirt 4.4.1 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.