Hi Vadym,
moving the discussion to the -dev list, which is the more appropriate
forum for this. Please reply to -dev; more comments inline.
On Sun, May 20, 2012 at 9:52 PM, Vadym Chepkov <vchepkov@gmail.com> wrote:
> Hi,
>
>
> The monitor operation of  iSCSILogicalUnit  is not specific enough in the regular expression and I got very "nice" fencing going because it was falsely reporting "failed to stop" resource.
>
> I happened to add primitive lun-build10, while already having lun-build1.
It would be bad if _that_ caused problems, but I'm unsure how that
would be related to your patch.
> For myself I have narrowed it down to the following fix, but probably a more appropriate regex has to be applied to these and other commands serving the same purpose for other iSCSI implementations.
>
> diff --git a/heartbeat/iSCSILogicalUnit b/heartbeat/iSCSILogicalUnit
> index 25ee32e..2cee970 100755
> --- a/heartbeat/iSCSILogicalUnit
> +++ b/heartbeat/iSCSILogicalUnit
> @@ -328,7 +328,7 @@ iSCSILogicalUnit_monitor() {
> Â Â Â Â tgt)
> Â Â Â Â Â Â # Figure out and set the target ID
> Â Â Â Â Â Â TID=`tgtadm --lld iscsi --op show --mode target \
> - Â Â Â Â Â Â Â | sed -ne "s/^Target \([[:digit:]]\+\): ${OCF_RESKEY_target_iqn}/\1/p"`
> + Â Â Â Â Â Â Â | sed -ne "s/^Target \([[:digit:]]\+\): ${OCF_RESKEY_target_iqn}$/\1/p"`
Adding the end-of-line anchor there does make good sense, but it would
only fix the case of there being two _targets_ sharing part of their
IQN, not two LUs with primitives similarly named. Do you have more
than one target, where the full IQN of one target is a substring of
the IQN of another?
> Â Â Â Â Â Â if [ -z "$TID" ]; then
> Â Â Â Â Â Â Â Â # Our target is not configured, thus we're not
> Â Â Â Â Â Â Â Â # running.
> @@ -337,7 +337,7 @@ iSCSILogicalUnit_monitor() {
> Â Â Â Â Â Â # This only looks for the backing store, but does not test
> Â Â Â Â Â Â # for the correct target ID and LUN.
> Â Â Â Â Â Â tgtadm --lld iscsi --op show --mode target \
> - Â Â Â Â Â Â Â | grep -E -q "[[:space:]]+Backing store.*: ${OCF_RESKEY_path}" && return $OCF_SUCCESS
> + Â Â Â Â Â Â Â | grep -E -q "[[:space:]]+Backing store.*: ${OCF_RESKEY_path}$" && return $OCF_SUCCESS
> Â Â Â Â Â Â ;;
> Â Â Â Â lio)
Here the "$" looks OK too, but here it would apply to two backing
devices with overlapping paths. I presume you named your LVs
"lun-build1" and "lun-build10" also, and they're in the same VG?
Cheers,
Florian
--
Need help with High Availability?
http://www.hastexo.com/now
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/
moving the discussion to the -dev list, which is the more appropriate
forum for this. Please reply to -dev; more comments inline.
On Sun, May 20, 2012 at 9:52 PM, Vadym Chepkov <vchepkov@gmail.com> wrote:
> Hi,
>
>
> The monitor operation of  iSCSILogicalUnit  is not specific enough in the regular expression and I got very "nice" fencing going because it was falsely reporting "failed to stop" resource.
>
> I happened to add primitive lun-build10, while already having lun-build1.
It would be bad if _that_ caused problems, but I'm unsure how that
would be related to your patch.
> For myself I have narrowed it down to the following fix, but probably a more appropriate regex has to be applied to these and other commands serving the same purpose for other iSCSI implementations.
>
> diff --git a/heartbeat/iSCSILogicalUnit b/heartbeat/iSCSILogicalUnit
> index 25ee32e..2cee970 100755
> --- a/heartbeat/iSCSILogicalUnit
> +++ b/heartbeat/iSCSILogicalUnit
> @@ -328,7 +328,7 @@ iSCSILogicalUnit_monitor() {
> Â Â Â Â tgt)
> Â Â Â Â Â Â # Figure out and set the target ID
> Â Â Â Â Â Â TID=`tgtadm --lld iscsi --op show --mode target \
> - Â Â Â Â Â Â Â | sed -ne "s/^Target \([[:digit:]]\+\): ${OCF_RESKEY_target_iqn}/\1/p"`
> + Â Â Â Â Â Â Â | sed -ne "s/^Target \([[:digit:]]\+\): ${OCF_RESKEY_target_iqn}$/\1/p"`
Adding the end-of-line anchor there does make good sense, but it would
only fix the case of there being two _targets_ sharing part of their
IQN, not two LUs with primitives similarly named. Do you have more
than one target, where the full IQN of one target is a substring of
the IQN of another?
> Â Â Â Â Â Â if [ -z "$TID" ]; then
> Â Â Â Â Â Â Â Â # Our target is not configured, thus we're not
> Â Â Â Â Â Â Â Â # running.
> @@ -337,7 +337,7 @@ iSCSILogicalUnit_monitor() {
> Â Â Â Â Â Â # This only looks for the backing store, but does not test
> Â Â Â Â Â Â # for the correct target ID and LUN.
> Â Â Â Â Â Â tgtadm --lld iscsi --op show --mode target \
> - Â Â Â Â Â Â Â | grep -E -q "[[:space:]]+Backing store.*: ${OCF_RESKEY_path}" && return $OCF_SUCCESS
> + Â Â Â Â Â Â Â | grep -E -q "[[:space:]]+Backing store.*: ${OCF_RESKEY_path}$" && return $OCF_SUCCESS
> Â Â Â Â Â Â ;;
> Â Â Â Â lio)
Here the "$" looks OK too, but here it would apply to two backing
devices with overlapping paths. I presume you named your LVs
"lun-build1" and "lun-build10" also, and they're in the same VG?
Cheers,
Florian
--
Need help with High Availability?
http://www.hastexo.com/now
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/