From mboxrd@z Thu Jan 1 00:00:00 1970 From: kupcevic@sourceware.org Date: 12 Jul 2006 16:52:57 -0000 Subject: [Cluster-devel] conga/ricci docs/storage_api.html modules/stor ... Message-ID: <20060712165257.19094.qmail@sourceware.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit CVSROOT: /cvs/cluster Module name: conga Changes by: kupcevic at sourceware.org 2006-07-12 16:52:56 Modified files: ricci/docs : storage_api.html ricci/modules/storage: LVM.cpp Added files: ricci/modules/storage: ClusterNotQuorateError.h Log message: storage module: prevent lvm tools to hang due to lack of cluster quorum Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/docs/storage_api.html.diff?cvsroot=cluster&r1=1.3&r2=1.4 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/ClusterNotQuorateError.h.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/LVM.cpp.diff?cvsroot=cluster&r1=1.3&r2=1.4 --- conga/ricci/docs/storage_api.html 2006/06/28 20:09:08 1.3 +++ conga/ricci/docs/storage_api.html 2006/07/12 16:52:56 1.4 @@ -5,7 +5,7 @@ Storage Module - +

Storage module manages all aspects of storage. Supports partition @@ -73,6 +73,11 @@ start clvmd:
1. lvm2-cluster needs to be installed
2. cluster infrastructure needs to be started
3. clvmd should be started (service clvmd start)

+
  • 5 ??? cluster not quorate
    LVM is configured to use cluster + locking mechanism, but cluster is not quorate. That would cause LVM + operations to hang until quorum is regained. User should make + cluster quorate before continuing. +



    /cvs/cluster/conga/ricci/modules/storage/ClusterNotQuorateError.h,v --> standard output revision 1.1 --- conga/ricci/modules/storage/ClusterNotQuorateError.h +++ - 2006-07-12 16:52:56.900818000 +0000 @@ -0,0 +1,41 @@ +/* + Copyright Red Hat, Inc. 2006 + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 675 Mass Ave, Cambridge, + MA 02139, USA. +*/ +/* + * Author: Stanko Kupcevic + */ + + +#ifndef ClusterNotQuorateError_h +#define ClusterNotQuorateError_h + +#include "Except.h" + + +class ClusterNotQuorateError : public Except +{ + public: + ClusterNotQuorateError() + : Except(5, std::string("Quorum required, but cluster not quorate")) {} + virtual ~ClusterNotQuorateError() + {} + +}; + + +#endif // ClusterNotQuorateError_h --- conga/ricci/modules/storage/LVM.cpp 2006/06/28 20:09:08 1.3 +++ conga/ricci/modules/storage/LVM.cpp 2006/07/12 16:52:56 1.4 @@ -28,6 +28,7 @@ #include "LV.h" #include "defines.h" #include "ClvmdError.h" +#include "ClusterNotQuorateError.h" #include @@ -690,10 +691,20 @@ LVM::check_locking() { if (get_locking_type() == "2") { - // try to start clvmd, if not running + // check if quorate string out, err; int status; vector args; + args.push_back("quorum"); + if (utils::execute("/sbin/magma_tool", args, out, err, status)) + throw string("execute failed"); + if (status) + throw string("cluster tools: magma_tool errored"); + if (out.find("Quorate") == out.npos) + throw ClusterNotQuorateError(); + + // try to start clvmd, if not running + args.clear(); args.push_back("clvmd"); args.push_back("start"); if (utils::execute("/sbin/service", args, out, err, status))