Bug 1079469 - [TEXT] taskcleaner.sh has dangerously misleading help text
Summary: [TEXT] taskcleaner.sh has dangerously misleading help text
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 3.3.0
Hardware: All
OS: Linux
high
urgent
Target Milestone: ---
: 3.4.0
Assignee: Eli Mesika
QA Contact: sefi litmanovich
URL:
Whiteboard: infra
Depends On:
Blocks: 1084774 rhev3.4snapshot2
TreeView+ depends on / blocked
 
Reported: 2014-03-21 16:14 UTC by James W. Mills
Modified: 2016-02-10 19:33 UTC (History)
10 users (show)

Fixed In Version: av5
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1084774 (view as bug list)
Environment:
Last Closed: 2014-06-12 14:05:08 UTC
oVirt Team: Infra
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 25996 0 None None None Never
oVirt gerrit 26004 0 None None None Never

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


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