Uploaded image for project: 'XenServer Org'
  1. XenServer Org
  2. XSO-893

mpathcount.py is running too often

    Details

    • Type: Bug
    • Status: Backlog (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 7.3, 7.4, 7.5
    • Fix Version/s: None
    • Component/s: Storage
    • Labels:
      None
    • Environment:

      We are taking snapshots of running vm every night on a pool of 3 Xenservers 7.2 (fully patched) connected to 2 iscsi SR with multipath.

    • Internal JIRA Reference:
      XSI-108

      Description

      Hi,

      I'm currently tracking bugs while taking snapshots of running vm every night on a LVM backend storage with multipath (seeĀ XSO-855)

      I noticed that mpathcount service was running on every change of a SR. In my case, it coould run more thant 500 times during a nightly backup. In some case, it could break the lvm command running on a sr and induce a lvm metadata corruption (only 2 processes were running at this time : a lvm command and mpathcount.py).

      Mpathcount should not run at every sr change and should run only while there is a real multiipath activity.

      This is a patched version I'm currently testing to limit unnecessary mpathcount invocations (/etc/udev/rules.d/40-multipath.rules) :

      SUBSYSTEM!="block", GOTO="end_mpath" 
      KERNEL!="dm-*", GOTO="end_mpath" 
      ACTION=="add", PROGRAM=="/bin/bash -c '/sbin/dmsetup info -c -o name --noheadings -j %M -m %m | /bin/grep VG_XenStorage'", GOTO="end_mpath" 
      ACTION=="add", PROGRAM=="/bin/bash -c '/sbin/dmsetup info -c -o name --noheadings -j %M -m %m | /bin/grep XSLocalEXT'", GOTO="end_mpath" 
      ACTION=="add|change", PROGRAM=="/sbin/dmsetup info -c -o name --noheadings -j %M -m %m", RESULT=="?*", SYMLINK+="disk/by-scsid/%c/mapper" 
      ACTION=="change", PROGRAM!="/sbin/dmsetup info -c --noheadings -j %M -m %m", GOTO="end_mpath" 
      PROGRAM!="/sbin/dmsetup info -c -o uuid,name --separator ' ' --noheadings -j %M -m %m", GOTO="end_mpath" 
      RESULT!="mpath-*", GOTO="end_mpath" 
      ENV{DM_ACTION}=="PATH_REINSTATED", GOTO="mpathcount" 
      ENV{DM_ACTION}=="PATH_FAILED", GOTO="mpathcount" 
      GOTO="end_mpath" 
      LABEL="mpathcount" 
      # ENV is necessary otherwise the child process of mpathcount cannot find multipathd executable 
      ACTION=="change", RUN+="/usr/bin/systemctl --no-block start mpcount.service" 
      LABEL="end_mpath"
      

      The logic is to call mpathcount only on event "PATH_REINSTATED" and "PATH_FAILED"...

      Regards,
      Nicolas Michaux

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              sarabanjina Nicolas Michaux
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: