Bug 1079469

Summary: [TEXT] taskcleaner.sh has dangerously misleading help text
Product: Red Hat Enterprise Virtualization Manager Reporter: James W. Mills <jamills>
Component: ovirt-engineAssignee: Eli Mesika <emesika>
Status: CLOSED CURRENTRELEASE QA Contact: sefi litmanovich <slitmano>
Severity: urgent Docs Contact:
Priority: high    
Version: 3.3.0CC: aberezin, acathrow, bazulay, gklein, iheim, lpeer, mkalinin, pstehlik, Rhev-m-bugs, yeylon
Target Milestone: ---Keywords: ZStream
Target Release: 3.4.0   
Hardware: All   
OS: Linux   
Whiteboard: infra
Fixed In Version: av5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1084774 (view as bug list) Environment:
Last Closed: 2014-06-12 14:05:08 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:
Bug Depends On:    
Bug Blocks: 1084774, 1090946    

Description James W. Mills 2014-03-21 16:14:58 UTC
Description of problem:
taskcleaner.sh -h says that the "-R" option "Removes all Zombie tasks.".  In fact, the "-R" option without the "-z" option will truncate the entire table, rather than look specifically for zombie tasks.  Below is the "Usage" output:

# cd /usr/share/ovirt-engine/setup/dbutils/
# ./taskcleaner.sh -h
Usage: taskcleaner.sh [-h] [-s server] [-p PORT]] [-d DATABASE] -u USERNAME [-l LOGFILE]  [-t taskId] [-c commandId] [-z] [-R] [-C] [-J] [-A] [-q] [-v]

	-s SERVERNAME - The database servername for the database  (def. localhost)
	-p PORT       - The database port for the database        (def. 5432)
	-d DATABASE   - The database name                         (def. engine)
	-u USERNAME   - The username for the database             (def. engine)
	-l LOGFILE    - The logfile for capturing output          (def. taskcleaner.sh.log)
	-t TASK_ID    - Removes a task by its Task ID.
	-c COMMAND_ID - Removes all tasks related to the given Command Id.
	-z            - Removes/Displays a Zombie task.
	-R            - Removes all Zombie tasks.
	-C            - Clear related compensation entries.
	-J            - Clear related Job Steps.
	-A            - Clear all Job Steps and compensation entries.
	-q            - Quite mode, do not prompt for confirmation.
	-v            - Turn on verbosity                         (WARNING: lots of output)
	-h            - This help text.

# ./taskcleaner.sh -u postgres -d engine -R
 This will remove all async_tasks table content!!! 
Caution, this operation should be used with care. Please contact support prior to running this command
Are you sure you want to proceed? [y/n]

With the "-z" option, you see the describe behavior for "-R":

# ./taskcleaner.sh -u postgres -d engine -R -z
 This will remove all Zombie Tasks in async_tasks table!!! 
Caution, this operation should be used with care. Please contact support prior to running this command
Are you sure you want to proceed? [y/n]


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

rhevm-setup-3.3.1-0.48.el6ev.noarch

How reproducible:
100%

Steps to Reproduce:

# cd /usr/share/ovirt-engine/setup/dbutils/
# ./taskcleaner.sh -h

Actual results:

Misleading information in the "-R" option

Usage: taskcleaner.sh [-h] [-s server] [-p PORT]] [-d DATABASE] -u USERNAME [-l LOGFILE]  [-t taskId] [-c commandId] [-z] [-R] [-C] [-J] [-A] [-q] [-v]

	-s SERVERNAME - The database servername for the database  (def. localhost)
	-p PORT       - The database port for the database        (def. 5432)
	-d DATABASE   - The database name                         (def. engine)
	-u USERNAME   - The username for the database             (def. engine)
	-l LOGFILE    - The logfile for capturing output          (def. taskcleaner.sh.log)
	-t TASK_ID    - Removes a task by its Task ID.
	-c COMMAND_ID - Removes all tasks related to the given Command Id.
	-z            - Removes/Displays a Zombie task.
	-R            - Removes all Zombie tasks.
	-C            - Clear related compensation entries.
	-J            - Clear related Job Steps.
	-A            - Clear all Job Steps and compensation entries.
	-q            - Quite mode, do not prompt for confirmation.
	-v            - Turn on verbosity                         (WARNING: lots of output)
	-h            - This help text.



Expected results:

More correct information in the "-R" option

Usage: taskcleaner.sh [-h] [-s server] [-p PORT]] [-d DATABASE] -u USERNAME [-l LOGFILE]  [-t taskId] [-c commandId] [-z] [-R] [-C] [-J] [-A] [-q] [-v]

	-s SERVERNAME - The database servername for the database  (def. localhost)
	-p PORT       - The database port for the database        (def. 5432)
	-d DATABASE   - The database name                         (def. engine)
	-u USERNAME   - The username for the database             (def. engine)
	-l LOGFILE    - The logfile for capturing output          (def. taskcleaner.sh.log)
	-t TASK_ID    - Removes a task by its Task ID.
	-c COMMAND_ID - Removes all tasks related to the given Command Id.
	-z            - Removes/Displays a Zombie task.
	-R            - Removes all tasks (use with -z to clear only zombie tasks).
	-C            - Clear related compensation entries.
	-J            - Clear related Job Steps.
	-A            - Clear all Job Steps and compensation entries.
	-q            - Quite mode, do not prompt for confirmation.
	-v            - Turn on verbosity                         (WARNING: lots of output)
	-h            - This help text.

Comment 2 sefi litmanovich 2014-03-31 07:59:27 UTC
Verified on rhevm-3.4.0-0.12.beta2.el6ev.noarch

Comment 4 Itamar Heim 2014-06-12 14:05:08 UTC
Closing as part of 3.4.0