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

Zhen Ren zren at suse.com
Tue Jul 28 02:12:00 PDT 2015


Hi Junxiao,

 >>>
> On 07/28/2015 01:28 PM, Zhen Ren wrote: 
> > 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?),  
>  
> Besides this, maybe you can write a systemd mount config file. 

Thanks.

> 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. 
> Yes, i just found this through the test. Looks like ocfs2 init script is 
> not called by "systemctl status ocfs2", you can try "systemctl restart 
> ocfs2" to have an consistent state. 

Yes, I know "systemctl restart ocfs2" can work around this problem.
The inconsistency problem only happens when first time to control ocfs2 by "systemctl" after a boot, maybe because
this patch will ignore stop operation if the status is not "started".

>  
> Thanks, 
> Junxiao. 
> >  
> > 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