Bug 1471095

Summary: "Unknown command" when trying to run 'thin_trim'
Product: Red Hat Enterprise Linux 7 Reporter: Jakub Krysl <jkrysl>
Component: device-mapper-persistent-dataAssignee: Joe Thornber <thornber>
Status: CLOSED ERRATA QA Contact: Jakub Krysl <jkrysl>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.4CC: agk, heinzm, jbrassow, lvm-team, mcsontos, msnitzer, prajnoha, thornber
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: device-mapper-persistent-data-0.7.3-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 13:17:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1469559    
Attachments:
Description Flags
Proposed patch to reinstate trim and show_duplicates to rpm none

Description Jakub Krysl 2017-07-14 12:18:53 UTC
Description of problem:
When trying to run 'thin_trim' I get: 
Unknown command 'thin_trim'
This tool is in "rpm -ql device-mapper-persistent-data" and there is a working manpage for it.
This was working in RHEL 7.3 (0.6.3-1.el7.x86_64)

Version-Release number of selected component (if applicable):
0.7.0-0.1.rc6.el7.x86_64 

How reproducible:
100%

Steps to Reproduce:
1.'thin_trim'


Actual results:
Unknown command 'thin_trim'

Expected results:
Usage: thin_trim [options] --metadata-dev {device|file} --data-dev {device|file}
Options:
  {-h|--help}
  {-V|--version}

Additional info:

Comment 3 Alasdair Kergon 2017-07-14 13:54:30 UTC
Reproduced.

Comment 4 Jonathan Earl Brassow 2017-07-14 17:04:56 UTC
I consider this to be a 7.5 + 7.4.z bug - not a 7.4 blocker.

We currently don't have a way to activate sub-LVs (metadata and data areas) in LVM that would make it simple to use tools like thin_repair/thin_trim manually.  Thus the number of people impacted by this before we can get a 7.4.z fix out for it would be very small.

Priority may be higher if other dmpd tools were affected, like 'thin_repair', 'thin_dump', etc.

Comment 5 Mike Snitzer 2017-07-14 17:52:57 UTC
thin_show_duplicates also doesn't working.

# for bin in `rpm -ql device-mapper-persistent-data | grep /usr/sbin`; do $bin ; done 2>&1 | grep "Unknown command"
Unknown command 'thin_show_duplicates'
Unknown command 'thin_trim'

Comment 6 Mike Snitzer 2017-07-14 18:15:01 UTC
Seems the quickest "fix" is to update the spec file to %configure using --enable-dev-tools.

Reassigning to Peter to see if he could enable that configure flag and respin for 7.5 (and 7.4.z).  Peter what do you think?

Comment 8 Alasdair Kergon 2017-07-14 23:51:15 UTC
Just changing the flag is insufficient.

Also needs: BuildRequires: ncurses-devel

Installed (but unpackaged) file(s) found:
   /usr/sbin/thin_generate_metadata
   /usr/sbin/thin_ll_dump
   /usr/sbin/thin_scan

Should those be shipped too?

Alternatively - the smallest fix - is perhaps just to adjust the #ifdef selection in the source file so that thin_trim and thin_show_duplicates work again.

Comment 10 Alasdair Kergon 2017-07-17 11:49:47 UTC
Created attachment 1299797 [details]
Proposed patch to reinstate trim and show_duplicates to rpm

Comment 14 Marian Csontos 2017-07-17 13:16:07 UTC
Oh, I see! It's the links are there, but support is not compiled.

Comment 15 Jakub Krysl 2017-07-18 06:58:16 UTC
Check BZ1469178, it is about thin_show_duplicates. It was filed before this and is related to this as thin_show_duplicates got added here. The difference between trim and show_duplicates bug is, show _duplicates is not a regression plus it is also missing a manpage.
There is a part duplicity and I believe it should be resolved based on how this bug will be solved.

Comment 16 Marian Csontos 2017-07-19 09:04:14 UTC
IMO the question is shall we drop them or keep pushing forward basically an useless patch?

Given it is not easy to use these, the simplest fix is to remove the "dangling" symlinks.

If we ever decide to ship these binaries, shall we move them to a subpackage?

As for ZStream eligibility, shall we wait for a request from customer? It does not work in Rawhide, and no one complained yet.

According to commit message 5f879237f5738ec1a66a5ab80eb60bda12256030:

    This builds tools that I want to keep in the same code base, but not
    intended for general release.

thin_trim moved to dev-tools in 03499560152967392a6ee6c1e418d21083eda5e9.

I am submitting a pull request to Joe, to install the symlinks only if configured so rpmdiff would spot the change.

Comment 17 Marian Csontos 2017-09-22 08:40:14 UTC
thin_trim moved to devtools in commit fd02dfa5bf65c5ba127a3da0aad853a88ace47fd and back in f7d79339e8da664d82f32e276a38744f050be9be. Joe, is that intentional?

Comment 18 Marian Csontos 2017-09-22 08:43:30 UTC
thin_show_duplicates half is Bug 1469178

Comment 22 Jakub Krysl 2017-10-09 09:02:07 UTC
Fixed in device-mapper-persistent-data-0.7.3-1.el7.

Comment 25 errata-xmlrpc 2018-04-10 13:17:29 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2018:0776