Bug 1320508

Summary: logconv.pl uses the older perl module DB_File.pm with limited functionality.
Product: Red Hat Enterprise Linux 7 Reporter: Hemant Yadav <hemant.yadav>
Component: 389-ds-baseAssignee: Noriko Hosoi <nhosoi>
Status: CLOSED NOTABUG QA Contact: Viktor Ashirov <vashirov>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.3CC: nkinder, rmeggins
Target Milestone: pre-dev-freeze   
Target Release: 7.4   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Feature: To use BerkeleyDB module of perl with enhanced functionality. Reason: DB_File uses deprecated functionality of quite old DB version. Result:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-04-14 16:34:59 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:

Description Hemant Yadav 2016-03-23 11:36:11 UTC
Description of problem:
I would not say it as bug.
But the Directory server logconv.pl enforces the Berkeley DB to use the deprecated functionality, as it uses DB_File perl module. As per the perl documentation f you want to make use of the new features available in Berkeley DB 2.x or greater, use the Perl module BerkeleyDB instead.

Version-Release number of selected component (if applicable):
389 DS 1.1.42 need version Berkeley 4.2.52 or later.

I think we should change the logconv.pl as below:
from->  use DB_File;
to-> use BerkeleyDB

Comment 2 Rich Megginson 2016-03-23 14:17:23 UTC
(In reply to Hemant Yadav from comment #0)
> Description of problem:
> I would not say it as bug.
> But the Directory server logconv.pl enforces the Berkeley DB to use the
> deprecated functionality, as it uses DB_File perl module. As per the perl
> documentation if you want to make use of the new features available in
> Berkeley DB 2.x or greater, use the Perl module BerkeleyDB instead.

perl-DB_File isn't exactly deprecated.  It is not marked as deprecated at http://perldoc.perl.org/DB_File.html.  If it is marked as deprecated, can you provide a link to that?

Are there specific features you want to use that are not available via the perl-DB_File interfaces?

logconv.pl uses very basic features of BDB.  I'm not sure how we could significantly improve logconv.pl by using BerkeleyDB instead of DB_File.

I would rather rewrite logconv in some other language (like python, or something newer like go? rust?), or figure out how to use off-the-shelf 3rd party logging parsers.

> 
> Version-Release number of selected component (if applicable):
> 389 DS 1.1.42 need version Berkeley 4.2.52 or later.

The documentation says this:
"Using DB_File with Berkeley DB version 2 or greater

Although DB_File is intended to be used with Berkeley DB version 1, it can also be used with version 2, 3 or 4. In this case the interface is limited to the functionality provided by Berkeley DB 1.x. Anywhere the version 2 or greater interface differs, DB_File arranges for it to work like version 1. This feature allows DB_File scripts that were built with version 1 to be migrated to version 2 or greater without any changes.

If you want to make use of the new features available in Berkeley DB 2.x or greater, use the Perl module BerkeleyDB instead."

And in fact perl-DB_File can use bdb 5.x:

$ cat /etc/fedora-release 
Fedora release 23 (Twenty Three)
$ ldd /usr/lib64/perl5/vendor_perl/auto/DB_File/DB_File.so
...
	libdb-5.3.so => /lib64/libdb-5.3.so (0x00007f5979411000)

> 
> I think we should change the logconv.pl as below:
> from->  use DB_File;
> to-> use BerkeleyDB

Comment 3 Noriko Hosoi 2016-03-23 16:38:08 UTC
Upstream ticket:
https://fedorahosted.org/389/ticket/48776

Comment 4 Hemant Yadav 2016-04-14 06:24:54 UTC
(In reply to Rich Megginson from comment #2)
> (In reply to Hemant Yadav from comment #0)
> > Description of problem:
> > I would not say it as bug.
> > But the Directory server logconv.pl enforces the Berkeley DB to use the
> > deprecated functionality, as it uses DB_File perl module. As per the perl
> > documentation if you want to make use of the new features available in
> > Berkeley DB 2.x or greater, use the Perl module BerkeleyDB instead.
> 
> perl-DB_File isn't exactly deprecated.  It is not marked as deprecated at
> http://perldoc.perl.org/DB_File.html.  If it is marked as deprecated, can
> you provide a link to that?
> 
> Are there specific features you want to use that are not available via the
> perl-DB_File interfaces?
> 
> logconv.pl uses very basic features of BDB.  I'm not sure how we could
> significantly improve logconv.pl by using BerkeleyDB instead of DB_File.
> 
> I would rather rewrite logconv in some other language (like python, or
> something newer like go? rust?), or figure out how to use off-the-shelf 3rd
> party logging parsers.
> 
> > 
> > Version-Release number of selected component (if applicable):
> > 389 DS 1.1.42 need version Berkeley 4.2.52 or later.
> 
> The documentation says this:
> "Using DB_File with Berkeley DB version 2 or greater
> 
> Although DB_File is intended to be used with Berkeley DB version 1, it can
> also be used with version 2, 3 or 4. In this case the interface is limited
> to the functionality provided by Berkeley DB 1.x. Anywhere the version 2 or
> greater interface differs, DB_File arranges for it to work like version 1.
> This feature allows DB_File scripts that were built with version 1 to be
> migrated to version 2 or greater without any changes.
> 
> If you want to make use of the new features available in Berkeley DB 2.x or
> greater, use the Perl module BerkeleyDB instead."
> 
> And in fact perl-DB_File can use bdb 5.x:
> 
> $ cat /etc/fedora-release 
> Fedora release 23 (Twenty Three)
> $ ldd /usr/lib64/perl5/vendor_perl/auto/DB_File/DB_File.so
> ...
> 	libdb-5.3.so => /lib64/libdb-5.3.so (0x00007f5979411000)
> 
> > 
> > I think we should change the logconv.pl as below:
> > from->  use DB_File;
> > to-> use BerkeleyDB

(In reply to Noriko Hosoi from comment #3)
> Upstream ticket:
> https://fedorahosted.org/389/ticket/48776

I havn't gone through the functionality of logconv.pl, that it uses the basic features of Berkeley DB. I just thought it might have got missed from the community to use the newer perl module.
I think we close this ticket if that is the case.
Thanks for the information Rich.

Comment 5 Noriko Hosoi 2016-04-14 16:34:59 UTC
Thanks for your notes, Hemant.

Closing this bug as you suggested.