RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1085119 - overkill of 'socket connect' messages when lvmetad is not running
Summary: overkill of 'socket connect' messages when lvmetad is not running
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: lvm2
Version: 7.0
Hardware: x86_64
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Petr Rockai
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On: 1016218
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-04-07 21:27 UTC by Corey Marthaler
Modified: 2023-03-08 07:26 UTC (History)
12 users (show)

Fixed In Version: lvm2-2.02.111-1.el7
Doc Type: Bug Fix
Doc Text:
If lvmetad use was enabled in lvm.conf (use_lvmetad = 1) but at the same time lvmetad was not available, lvm commands would print an error message (about lvmetad being unavavailable) multiple times instead of just once. This has been remedied and there will be only one error message in those cases.
Clone Of: 1016218
Environment:
Last Closed: 2015-03-05 13:07:58 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 650503 0 None None None Never
Red Hat Product Errata RHBA-2015:0513 0 normal SHIPPED_LIVE lvm2 bug fix and enhancement update 2015-03-05 16:14:41 UTC

Comment 2 Corey Marthaler 2014-04-07 21:29:19 UTC
Looks like we never cloned this for rhel7.0.

3.10.0-116.el7.x86_64
lvm2-2.02.105-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
lvm2-libs-2.02.105-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
lvm2-cluster-2.02.105-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
device-mapper-1.02.84-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
device-mapper-libs-1.02.84-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
device-mapper-event-1.02.84-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
device-mapper-event-libs-1.02.84-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
device-mapper-persistent-data-0.3.0-1.el7    BUILT: Fri Mar 28 07:42:24 CDT 2014
cmirror-2.02.105-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014

Comment 3 Peter Rajnoha 2014-04-08 07:26:52 UTC
(In reply to Corey Marthaler from comment #2)
> Looks like we never cloned this for rhel7.0.

Well, in RHEL7 this works a bit differently with systemd. There's always lvm2-lvmetad.socket systemd unit ready to start the lvmetad when needed and it works like this:

  - at the very beginning, the /lib/systemd/systemd-generators/lvm2-activation-generator is executed by systemd, the generator looks at /etc/lvm.conf and checkes the global/use_lvmetad setting and then it does the following based on what it finds:

  A. if global/use_lvmetad=1 (default), then the generator exits immediately (it *does not* generate lvm2-activation-early.service, lvm2-activation.service and lvm2-activation-net.service) and the boot continues and the first lvmetad socket access causes the lvmetad to start which then also causes all the LVM volumes to be autoactivated as the underlying PVs appear in the system

  B. if global/use_lvmetad=0, then the generator generates lvm2-activation-early.service, lvm2-activation.service and lvm2-activation-net.service which activate the LVM volumes directly (there's no autoactivation since we're not using lvmetad which is essential for this feature)

Simply, we shouldn't get the error message ("connect failed") as seen on RHEL6 because there's always the lvm2-lvmetad.socket unit ready to start the lvmetad daemon if needed and all requests should be always handled unless lvmetad crashed or the lvm2-lvmetad.socket systemd unit got disabled.

The error messages are (were) visible on RHEL6 because some services (the ones that activated LVs at boot - the vgchange used in rc.sysinit etc.) used the global lvm.conf with use_lvmetad=1 and at the same time lvmetad was not yet running since it was started a bit later as another service... And the vgchange in rc.sysinit tried to use lvmetad (based on use_lvmetad=1 found in lvm.conf).

Do you see these messages in RHEL7?

Comment 4 Corey Marthaler 2014-04-08 22:16:13 UTC
# Newly created virt system

3.10.0-116.el7.x86_64
lvm2-2.02.105-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
lvm2-libs-2.02.105-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
lvm2-cluster-2.02.105-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
device-mapper-1.02.84-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
device-mapper-libs-1.02.84-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
device-mapper-event-1.02.84-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
device-mapper-event-libs-1.02.84-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
device-mapper-persistent-data-0.3.0-1.el7    BUILT: Fri Mar 28 07:42:24 CDT 2014
cmirror-2.02.105-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014


[root@host-029 ~]# pvscan
  /run/lvm/lvmetad.socket: connect failed: Connection refused
  WARNING: Failed to connect to lvmetad: Connection refused. Falling back to internal scanning.
  /run/lvm/lvmetad.socket: connect failed: Connection refused
  /run/lvm/lvmetad.socket: connect failed: Connection refused
  /run/lvm/lvmetad.socket: connect failed: Connection refused
  /run/lvm/lvmetad.socket: connect failed: Connection refused
  /run/lvm/lvmetad.socket: connect failed: Connection refused
  /run/lvm/lvmetad.socket: connect failed: Connection refused
  /run/lvm/lvmetad.socket: connect failed: Connection refused
  /run/lvm/lvmetad.socket: connect failed: Connection refused
  /run/lvm/lvmetad.socket: connect failed: Connection refused
  /run/lvm/lvmetad.socket: connect failed: Connection refused
  /run/lvm/lvmetad.socket: connect failed: Connection refused
  /run/lvm/lvmetad.socket: connect failed: Connection refused
  /run/lvm/lvmetad.socket: connect failed: Connection refused
  /run/lvm/lvmetad.socket: connect failed: Connection refused
  /run/lvm/lvmetad.socket: connect failed: Connection refused
  /run/lvm/lvmetad.socket: connect failed: Connection refused
  /run/lvm/lvmetad.socket: connect failed: Connection refused
  /run/lvm/lvmetad.socket: connect failed: Connection refused
  PV /dev/vda2   VG rhel_host-029   lvm2 [7.51 GiB / 0    free]
  Total: 1 [7.51 GiB] / in use: 1 [7.51 GiB] / in no VG: 0 [0   ]

[root@host-029 ~]# systemctl status lvm2-lvmetad.socket
lvm2-lvmetad.socket - LVM2 metadata daemon socket
   Loaded: loaded (/usr/lib/systemd/system/lvm2-lvmetad.socket; disabled)
   Active: inactive (dead) since Tue 2014-04-08 14:38:02 CDT; 2h 33min ago
     Docs: man:lvmetad(8)
   Listen: /run/lvm/lvmetad.socket (Stream)

Apr 08 14:38:02 host-029.virt.lab.msp.redhat.com systemd[1]: Stopping LVM2 metadata daemon socket.
Apr 08 14:38:02 host-029.virt.lab.msp.redhat.com systemd[1]: Closed LVM2 metadata daemon socket.

[root@host-029 ~]# systemctl start lvm2-lvmetad.socket
[root@host-029 ~]# pvscan
  PV /dev/vda2   VG rhel_host-029   lvm2 [7.51 GiB / 0    free]
  Total: 1 [7.51 GiB] / in use: 1 [7.51 GiB] / in no VG: 0 [0   ]

[root@host-029 ~]# systemctl stop lvm2-lvmetad.socket
[root@host-029 ~]# pvscan
  /run/lvm/lvmetad.socket: connect failed: Connection refused
  WARNING: Failed to connect to lvmetad: Connection refused. Falling back to internal scanning.
  /run/lvm/lvmetad.socket: connect failed: Connection refused
  /run/lvm/lvmetad.socket: connect failed: Connection refused
  /run/lvm/lvmetad.socket: connect failed: Connection refused
  /run/lvm/lvmetad.socket: connect failed: Connection refused
  /run/lvm/lvmetad.socket: connect failed: Connection refused
  /run/lvm/lvmetad.socket: connect failed: Connection refused
  /run/lvm/lvmetad.socket: connect failed: Connection refused
  /run/lvm/lvmetad.socket: connect failed: Connection refused
  /run/lvm/lvmetad.socket: connect failed: Connection refused
  /run/lvm/lvmetad.socket: connect failed: Connection refused
  /run/lvm/lvmetad.socket: connect failed: Connection refused
  /run/lvm/lvmetad.socket: connect failed: Connection refused
  /run/lvm/lvmetad.socket: connect failed: Connection refused
  /run/lvm/lvmetad.socket: connect failed: Connection refused
  /run/lvm/lvmetad.socket: connect failed: Connection refused
  /run/lvm/lvmetad.socket: connect failed: Connection refused
  /run/lvm/lvmetad.socket: connect failed: Connection refused
  /run/lvm/lvmetad.socket: connect failed: Connection refused
  PV /dev/vda2   VG rhel_host-029   lvm2 [7.51 GiB / 0    free]
  Total: 1 [7.51 GiB] / in use: 1 [7.51 GiB] / in no VG: 0 [0   ]

Comment 5 Peter Rajnoha 2014-04-09 07:24:35 UTC
(In reply to Corey Marthaler from comment #4)
> [root@host-029 ~]# systemctl status lvm2-lvmetad.socket
> lvm2-lvmetad.socket - LVM2 metadata daemon socket
>    Loaded: loaded (/usr/lib/systemd/system/lvm2-lvmetad.socket; disabled)

This should have been enabled by default after new package installation based on /lib/systemd/system-preset/90-default.preset with this line: "enable lvm2-lvmetad.*". If it's not, it's an lvmetad issue then.

However, if it's an upgrade from previous lvm2 package and if the socket unit was disabled before, the state is preserved...

Comment 6 Peter Rajnoha 2014-04-09 14:00:25 UTC
(In reply to Peter Rajnoha from comment #5)
> This should have been enabled by default after new package installation
> based on /lib/systemd/system-preset/90-default.preset with this line:
> "enable lvm2-lvmetad.*". If it's not, it's an lvmetad issue then.

s/lvmetad issue/systemd issue

Comment 7 Alasdair Kergon 2014-04-10 23:01:32 UTC
A couple of options:

1) Set internal state to say that lvmetad is disabled and fall back to scanning like the warning messages say has happened i.e. do not continue repeatedly trying to contact lvmetad;

2) For read commands, reduce the error messages after the first to debug level and continue running;  for update commands, give a hard failure telling the user they must restart lvmetad or turn it off in the configuration.

I think (1) is likely to be sufficient: if the daemon isn't running (or is uncontactable) it's still safe to proceed, and when it does get restarted, its state will get repopulated correctly again.

Comment 8 Alasdair Kergon 2014-04-10 23:04:04 UTC
Those comments are based on the actual subject of this bugzilla.  Why it didn't get started up should probably be discussed in a different place.

Comment 9 Petr Rockai 2014-04-14 10:42:19 UTC
Seems to be a regression (the error message spam). I'll look at it.

Comment 10 Petr Rockai 2014-06-08 20:13:28 UTC
Fixed upstream in 02e1bf406b2fc9731b2f67c273acd8f21df64714. We now only try to connect once and remember if we failed.

Comment 11 Ludek Smid 2014-06-26 11:16:57 UTC
This request was not resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you need
to escalate this bug.

Comment 13 Nenad Peric 2015-01-16 13:42:36 UTC
I cannot really seem to reproduce it since lvmetad starts automatically as soon as a command is executed and use_lvmetad is set to 1 in the config. 

Stopping lvmetad was just tempolrary since it would restart itself on a new lvm command.

I will however mark this as VERIFIED since the behavior stated in the opening of the bug no longer happens.
Verified with:



3.10.0-223.el7.x86_64

lvm2-2.02.114-5.el7    BUILT: Wed Jan 14 15:42:28 CET 2015
lvm2-libs-2.02.114-5.el7    BUILT: Wed Jan 14 15:42:28 CET 2015
lvm2-cluster-2.02.114-5.el7    BUILT: Wed Jan 14 15:42:28 CET 2015
device-mapper-1.02.92-5.el7    BUILT: Wed Jan 14 15:42:28 CET 2015
device-mapper-libs-1.02.92-5.el7    BUILT: Wed Jan 14 15:42:28 CET 2015
device-mapper-event-1.02.92-5.el7    BUILT: Wed Jan 14 15:42:28 CET 2015
device-mapper-event-libs-1.02.92-5.el7    BUILT: Wed Jan 14 15:42:28 CET 2015
device-mapper-persistent-data-0.4.1-2.el7    BUILT: Wed Nov 12 19:39:46 CET 2014
cmirror-2.02.114-5.el7    BUILT: Wed Jan 14 15:42:28 CET 2015

Comment 15 errata-xmlrpc 2015-03-05 13:07:58 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://rhn.redhat.com/errata/RHBA-2015-0513.html


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