Hi Dejan,

On Wed, 2011-02-23 at 18:03 +0100, Holger Teutsch wrote:
> Hi Dejan,
> 
> On Wed, 2011-02-23 at 11:54 +0100, Dejan Muhamedagic wrote:
> > Hi Holger,
> > 
> > On Tue, Feb 22, 2011 at 06:25:37PM +0100, Holger Teutsch wrote:
> > > Hi,
> > > I resubmit the db2 agent for inclusion into the project. Besides fixing
> > > some loose ends the major change is a reimplementation of attribute
> > > management. Now the attributes are of type "-t nodes -l reboot". IMHO
> > > all concerns raised during the first review are fixed now.
> > > 
> > > The new agent passes the ocft test 8-).
> > 
> > :) BTW, did you consider testing promote/demote too? Would that
> > be possible?
> 
> I will always stay compatible ( 8-) ): so once the new agent is in the
> repository I will work this (although not sure about viability).
> 
> > 
> > > Collateral documentation is in
> > > 
> > > http://www.linux-ha.org/wiki/Db2_(resource_agent)
> > 
> > Great!
> > 
> > > For reference purposes I include a diff against the last submission.
> > > 
> > > Regards
> > > Holger
> 
> See answers below, new version will come in a subsequent mail.
> - holger
> 

new version is attached


------- reference only ------------
diff -r 55ecf1c94d6e -r e3ee26659c50 db2
--- a/db2       Tue Feb 22 18:15:50 2011 +0100
+++ b/db2       Wed Feb 23 18:24:59 2011 +0100
@@ -103,7 +103,7 @@
 <longdesc lang="en">
 The number of the partion (DBPARTITIONNUM) to be managed.
 </longdesc>
-<shortdesc lang="en">Number of partion</shortdesc>
+<shortdesc lang="en">database partition number (DBPARTITIONNUM)</shortdesc>
 <content type="string" default="0" />
 </parameter>
 </parameters>
@@ -249,7 +249,7 @@
         me=$(uname -n)
 
         # loop over all member nodes and set attribute
-        crm_node -l |\
+        crm_node -l |
         while read id node member
         do
             [ "$member" = member -a "$node" != "$me" ] || continue
@@ -299,7 +299,7 @@
     output=$(runasdb2 db2 get db cfg for $db)
     [ $? != 0 ] && return $OCF_ERR_GENERIC
 
-    hadr_vars=$(echo "$output" |\
+    hadr_vars=$(echo "$output" |
         awk '/HADR database role/ {printf "HADR_ROLE='%s'; ", $NF;}
             /HADR_TIMEOUT/ {printf "HADR_TIMEOUT='%s'; ", $NF;}
             /First active log file/ {printf "FIRST_ACTIVE_LOG='%s'\n", $NF;}
@@ -504,6 +504,9 @@
     # remove master score
     crm_master -D -l reboot
 
+    # be very early here in order to avoid stale data
+    rm -f $STATE_FILE
+
     if ! db2_instance_status
     then
         ocf_log info "DB2 instance $instance already stopped"
@@ -572,7 +575,6 @@
         ocf_log info "DB2 instance $instance($db2node) is now dead"
     fi
 
-    rm -f $STATE_FILE
     return $OCF_SUCCESS
 }
 
@@ -613,7 +615,7 @@
         return 1 
     fi
 
-    echo "$output" |\
+    echo "$output" |
     awk '/^HADR is not active/ {print "Standard/Standalone"; exit; }
          /^Role *State */ {getline; printf "%s/%s\n", $1, $2; exit; }'
 }

Attachment: db2
Description: application/shellscript

_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to