[Ocfs2-tools-devel] [PATCH 3/6] o2cb: don't write sysconfig if status not changed

Zhen Ren zren at suse.com
Mon Jul 27 22:28:49 PDT 2015


Hi Junxiao,

Did you notice the following problematic scenarios with o2cb cluster stack?

if you want to mount ocfs2 at boot  time by adding record to /etc/fstab (any other better method can do this?), after cluster bring up,
each node success to mount, 'systemctl status o2cb' looks good, but 'systemctl status ocfs2' looks  bad. At this time, using 'systemctl
stop ocfs2' won't work because it has been recorded 'stopped'.  Inconsistency happens.

How should we handle this situation?
--
s3:~ # systemctl status o2cb
o2cb.service - LSB: Load O2CB cluster services at system boot.
   Loaded: loaded (/etc/init.d/o2cb)
   Active: active (running) since Mon 2015-07-27 10:37:29 CST; 1 day 2h ago
  Process: 1259 ExecStart=/etc/init.d/o2cb start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/o2cb.service
           └─1365 o2hbmonitor

Jul 27 10:37:28 s3 o2cb[1259]: Loading filesystem "configfs": OK
Jul 27 10:37:28 s3 o2cb[1259]: Loading stack plugin "o2cb": OK
Jul 27 10:37:29 s3 o2cb[1259]: Loading filesystem "ocfs2_dlmfs": OK
Jul 27 10:37:29 s3 o2cb[1259]: Mounting ocfs2_dlmfs filesystem at /dlm: OK
Jul 27 10:37:29 s3 o2cb[1259]: Setting cluster stack "o2cb": OK
Jul 27 10:37:29 s3 o2cb[1259]: Registering O2CB cluster "hacluster": OK
Jul 27 10:37:29 s3 o2cb[1259]: Setting O2CB cluster timeouts : OK
Jul 27 10:37:29 s3 o2hbmonitor[1365]: Starting

--
s3:~ # systemctl status ocfs2
ocfs2.service - LSB: Mount OCFS2 volumes at boot.
   Loaded: loaded (/etc/init.d/ocfs2)
   Active: failed (Result: exit-code) since Mon 2015-07-27 10:37:29 CST; 1 day 2h ago
  Process: 1366 ExecStart=/etc/init.d/ocfs2 start (code=exited, status=1/FAILURE)

Jul 27 10:37:29 s3 ocfs2[1366]: Starting Oracle Cluster File System (OCFS2) mount: can't find UUID=251fa3d4-fe6a-4c73-97dd-43026e76c05c
Jul 27 10:37:29 s3 ocfs2[1366]: ..failed

 >>>
> Signed-off-by: Junxiao Bi <junxiao.bi at oracle.com> 
> --- 
>  vendor/common/o2cb.init.sh |   16 ++++++++++------ 
>  1 file changed, 10 insertions(+), 6 deletions(-) 
>  
> diff --git a/vendor/common/o2cb.init.sh b/vendor/common/o2cb.init.sh 
> index 9e0b31c..e2f80f7 100755 
> --- a/vendor/common/o2cb.init.sh 
> +++ b/vendor/common/o2cb.init.sh 
> @@ -1925,16 +1925,20 @@ case "$1" in 
>          ;; 
>   
>      enable) 
> -        O2CB_ENABLED=true 
> -        write_sysconfig 
> -        if_fail "$?" "Unable to write the driver configuration" 
> +        if [ "$O2CB_ENABLED" != "true" ]; then 
> +            O2CB_ENABLED=true 
> +            write_sysconfig 
> +            if_fail "$?" "Unable to write the driver configuration" 
> +        fi 
>          start 
>          ;; 
>   
>      disable) 
> -        O2CB_ENABLED=false 
> -        write_sysconfig 
> -        if_fail "$?" "Unable to write the driver configuration" 
> +        if [ "$O2CB_ENABLED" != "false" ]; then 
> +            O2CB_ENABLED=false 
> +            write_sysconfig 
> +            if_fail "$?" "Unable to write the driver configuration" 
> +        fi 
>          stop 
>          ;; 
>   
 



--
Eric, Ren





More information about the Ocfs2-tools-devel mailing list