Translated message

A translation of this page exists in English.

Warning message

This translation is outdated. For the most up-to-date information, please refer to the English version.

RHEL 6 に "self_fence=on" および "force_unmount=on" を設定した場合にノードが再起動せず、サブマウントにより fs リソースが失敗します

Solution Unverified - Updated -

Environment

  • Red Hat Enterprise Linux (RHEL) 6 (および High Availability アドオン)
  • /etc/cluster/cluster.conf における 1 つまたは複数のファイルシステムベースのリソース (fsclusterfsnetfs など)

Issue

  • アクティブなサブマウントによって fs リソースが停止しない場合は、self_fence に失敗します (ノードが再起動しません)。
  • "force_unmount" オプションが有効な場合は、"self_fence=on" ロジックが実行されません。

Resolution

回避方法: リソースで force_unmount 属性を無効にします。たとえば、次のようになります。

<fs name="myFS" fstype="ext4" device="/dev/test/lv1" mountpoint="/mnt/lv1" self_fence="on" force_unmount="off"/>

Root Cause

この問題は現在 Bugzilla #908457 でRed Hat Engineering によって追跡されています。

プロセスがそれをアクティブに使用している場合を除いて fs ベースのリソースが停止できない場合は、リソースのエージェントが "self fence" ロジックを飛ばす可能性があります。これにより、ノードが再起動するのではなく、サービスが failed 状態になります。なぜなら、リソースエージェントのファイルシステムライブラリーにある、fuser が 1 を返すとエラーを返すロジックによってセルフフェンスのチェックが実行されないためです。fuser が kill するプロセスを見つけられない時 (たとえばカーネルのサブシステムがそれを使用したり、サブマウントがそのファイルシステムを使用している場合) にこの状況が生じ、ファイルシステムをアンマウントできません。

Diagnostic Steps

ファイルシステム (/data) のリソースを "self_fence=on" および "force_unmount=on" オプション (/etc/cluster/cluster.conf ファイルの <fs> タグ) で作成します。それから、ファイルシステムの一番上 (/data/mnt) に小さい ISO イメージをマウントします。このマウントにより、ファイルシステムのリソースが自身をアンマウントすることができず、理論的には "self_fence" オプションのトリガーとなります。

node2:/var/log/messages:
Jan 28 09:25:05 node2 rgmanager[40100]:I am node #2
Jan 28 09:25:05 node2 rgmanager[40100]:Resource Group Manager Starting
Jan 28 09:25:05 node2 rgmanager[40100]:Loading Service Data
Jan 28 09:25:07 node2 rgmanager[40100]:Initializing Services
Jan 28 09:25:07 node2 rgmanager[40892]:[fs] /dev/dm-21 is not mounted
Jan 28 09:25:07 node2 rgmanager[40100]:Services Initialized
Jan 28 09:25:07 node2 rgmanager[40100]:State change:Local UP
Jan 28 09:25:07 node2 rgmanager[40100]:State change: node1-priv UP
Jan 28 09:25:25 node2 rgmanager[41067]:[fs] mounting /dev/dm-21 on /data
Jan 28 09:25:25 node2 rgmanager[41087]:[fs] mount   /dev/dm-21 /data
Jan 28 09:25:25 node2 rgmanager[40100]:Service service:fstest_node2 started
Jan 28 09:26:07 node2 corosync[39213]:   [CKPT  ] Checkpoint dlmplock.rgmanager (18):
Jan 28 09:26:09 node2 corosync[39213]:   [CKPT  ] Checkpoint dlmplock.rgmanager (18):
Jan 28 09:29:18 node2 rgmanager[40100]:Stopping service service:fstest_node2
Jan 28 09:29:18 node2 rgmanager[43405]:[fs] unmounting /data
Jan 28 09:29:19 node2 rgmanager[43446]:[fs] Sending SIGTERM to processes on /data
Jan 28 09:29:24 node2 rgmanager[43527]:[fs] unmounting /data
Jan 28 09:29:24 node2 rgmanager[43568]:[fs] Sending SIGKILL to processes on /data
Jan 28 09:29:24 node2 rgmanager[40100]: stop on fs "node2_data" returned 1 (generic error)
Jan 28 09:29:24 node2 rgmanager[40100]:#12:RG service:fstest_node2 failed to stop; intervention required
Jan 28 09:29:24 node2 rgmanager[40100]:Service service:fstest_node2 is failed

以下は、ハングアップしている "umount" プロセスを kill するために "fuser" を試行するコードおよび行番号です。
/usr/share/cluster/utils/fs-lib.sh:

...
844 # Force unmount: try #1: send SIGTERM
845 if [ $try -eq 1 ]; then
846    # Try fs-specific force-unmount, if provided
847    do_force_unmount
848    if [ $?-eq 0 ]; then
849       # if this succeeds, we should be done
850       continue
851    fi
852
853    ocf_log warning "Sending SIGTERM to processes on $mp"
854    fuser -TERM -kvm "$mp"
855    continue
856 else
857    ocf_log warning "Sending SIGKILL to processes on $mp"
858    fuser -kvm "$mp"
859
860    case $? in
861         0)
862           ;;
863         1)
864           return $OCF_ERR_GENERIC
865           ;;
866         2)
867           break
868           ;;
869    esac
870 fi
...

"self_fence" が有効 (かつ $umount_failed=yes) な場合、ノードは自分で再起動する必要があります。"force_unmount" が有効でアンマウントに失敗していると、このコードブロックは実行されません。

...
885 if [ -n "$umount_failed" ]; then
886    ocf_log err "'umount $mp' failed, error=$ret_val"
887 
888    if [ "$self_fence" ]; then
889       ocf_log alert "umount failed - REBOOTING"
890       sync
891       reboot -fn
892    fi
893       return $OCF_ERR_GENERIC
894 fi
...

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments