Skip to contentSkip to conversation

conga/ricci docs/storage_api.html modules/stor ...

Cluster-devel [email protected] 1 participant 1 message Jul 12, 2006

lore
Share & tools
lore
#0 lore raw

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

ricci/docs/storage_api.html +6 -1
@@ -5,7 +5,7 @@
 	<TITLE>Storage Module</TITLE>
 	<META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.2  (Linux)">
 	<META NAME="CREATED" CONTENT="20060410;13011800">
-	<META NAME="CHANGED" CONTENT="20060626;19014000">
+	<META NAME="CHANGED" CONTENT="20060712;12410300">
 </HEAD>
 <BODY LANG="en-US" DIR="LTR">
 <P>Storage module manages all aspects of storage. Supports partition
@@ -73,6 +73,11 @@
 	start clvmd: <BR>1. lvm2-cluster needs to be installed<BR>2. cluster
 	infrastructure needs to be started<BR>3. clvmd should be started
 	(service clvmd start)</P>
+	<LI><P>5 ??? cluster not quorate<BR>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. 
+	</P>
 </UL>
 <P><BR><BR>
 </P>

/cvs/cluster/conga/ricci/modules/storage/ClusterNotQuorateError.h,v --> standard output revision 1.1

- renamed from ricci/modules/storage/ClusterNotQuorateError.h +41 -0

41 lines not on this page · raw message

ricci/modules/storage/LVM.cpp +12 -1
@@ -28,6 +28,7 @@
 #include "LV.h"
 #include "defines.h"
 #include "ClvmdError.h"
+#include "ClusterNotQuorateError.h"
 
 #include <vector>
 
@@ -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<string> 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))