Bug 1413834 - __dbi_htconfig macro is not available in RHEL7
Summary: __dbi_htconfig macro is not available in RHEL7
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: anaconda
Version: 7.3
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: Anaconda Maintenance Team
QA Contact: Release Test Team
Depends On:
Blocks: 1420851
TreeView+ depends on / blocked
Reported: 2017-01-17 05:39 UTC by Masahiro Matsuya
Modified: 2020-06-11 13:12 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2017-06-19 17:03:36 UTC
Target Upstream Version:

Attachments (Terms of Use)
proposed patch (revised) (805 bytes, patch)
2017-01-19 02:06 UTC, Masahiro Matsuya
no flags Details | Diff

Description Masahiro Matsuya 2017-01-17 05:39:06 UTC
Description of problem:
__dbi_htconfig macro is specified in arguments of anaconda-yum command.

13:20:52,910 INFO program: Running... /usr/libexec/anaconda/anaconda-yum --config /tmp/anaconda-yum.conf --tsfile /mnt/sysimage/anaconda-yum.yumtx --rpmlog /tmp/rpm-script.log --installroot /mnt/sysimage --release 7.3 --arch x86_64 --macro __dbi_htconfig hash nofsync %{__dbi_other} %{__dbi_perms} --macro __file_context_path /etc/selinux/targeted/contexts/files/file_contexts

But, it doesn't have any effect in RHEL7, since it's not used anywhere.
After searching it in internet, some environment has /usr/lib/rpm/macros with the __dbi_htconfig macro. But, RHEL7 doesn't have it.

_dbi_config should be used directly.

  NOTE: it's not __dbi_config. the heading underscore (_) is just one.
        __dbi_htconfig has the two underscore, though.

I have a customer with a performance issue of installation with md raid.
It took 1 hour and 10 minutes to complete the installation.
It finished in 20 minutes without md raid.

I figured out that it took much time for anaconda-yum. and I found fdatasync() system call was the most time consuming system call in it. Also, it seems that 
fdatasync() was called for rpmdb in collected strace data. But, when 'nofsync' is configured with rpmdb configuration in rpm macros, it should not happen.

In /usr/lib/macros:
# ---- Database configuration macros.
#       Macros used to configure Berkley db parameters.
#   nofsync             Disable fsync(2) call performed after db3 writes?

# Misc BDB tuning options

%__dbi_other                    mp_mmapsize=128Mb mp_size=1Mb

%_dbi_config                    %{?__dbi_other}

nofsync is not used by default. 

Version-Release number of selected component (if applicable):
Red Hat Enterprise Linux 7

How reproducible:

Steps to Reproduce:
1. install rhel7.3
2. check if many fdatasync() is called with strace on background shell while anaconda-yum is running for package installation.

Actual results:
fdatasync() is called many times.

Expected results:
fdatasync() is called a few. In my case, it's just once after changing into __dbi_htconfig into _dbi_config.

Comment 1 Masahiro Matsuya 2017-01-17 05:44:44 UTC
Created attachment 1241542 [details]
proposed patch

removed %{__dbi_perms} as well, because it's not defined in any rpm macros of RHEL7.

Comment 2 Masahiro Matsuya 2017-01-19 02:06:34 UTC
Created attachment 1242321 [details]
proposed patch (revised)

hash db option is not available as well.
I saw the following error in packaging.log during installation.

  08:12:50,746 DEBUG packaging: error: unrecognized db option: "hash" ignored.

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