<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
 <HEAD>
   <TITLE> [DRBD-user] DRBD 8.4 agent sets fallback master score 5
   </TITLE>
   <LINK REL="Index" HREF="index.html" >
   <LINK REL="made" HREF="mailto:drbd-user%40lists.linbit.com?Subject=Re%3A%20%5BDRBD-user%5D%20DRBD%208.4%20agent%20sets%20fallback%20master%20score%205&In-Reply-To=%3C20110728153837.GA8804%40barkeeper1-xen.linbit%3E">
   <META NAME="robots" CONTENT="index,nofollow">
   <META http-equiv="Content-Type" content="text/html; charset=us-ascii">
   <LINK REL="Previous"  HREF="016536.html">
   <LINK REL="Next"  HREF="016532.html">
 </HEAD>
 <BODY BGCOLOR="#ffffff">
   <H1>[DRBD-user] DRBD 8.4 agent sets fallback master score 5</H1>
    <B>Lars Ellenberg</B> 
    <A HREF="mailto:drbd-user%40lists.linbit.com?Subject=Re%3A%20%5BDRBD-user%5D%20DRBD%208.4%20agent%20sets%20fallback%20master%20score%205&In-Reply-To=%3C20110728153837.GA8804%40barkeeper1-xen.linbit%3E"
       TITLE="[DRBD-user] DRBD 8.4 agent sets fallback master score 5">lars.ellenberg at linbit.com
       </A><BR>
    <I>Thu Jul 28 17:38:37 CEST 2011</I>
    <P><UL>
        <LI>Previous message: <A HREF="016536.html">[DRBD-user] DRBD 8.4 agent sets fallback master score 5
</A></li>
        <LI>Next message: <A HREF="016532.html">[DRBD-user] Deleting directories/files from drbd drive getting hung	for some time.
</A></li>
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#16541">[ date ]</a>
              <a href="thread.html#16541">[ thread ]</a>
              <a href="subject.html#16541">[ subject ]</a>
              <a href="author.html#16541">[ author ]</a>
         </LI>
       </UL>
      <p><b>Note: "permalinks"</b> may not be as permanent as we would like,<br>direct links of old sources may well be <b>a few messages off.</b></p>
    <HR>  
<!--beginarticle-->
<PRE>On Tue, Jul 26, 2011 at 02:10:42PM +0200, Dominik Klein wrote:
&gt;<i> Hi
</I>&gt;<i> 
</I>&gt;<i> as discussed on IRC with fghaas, I see an error with a setup of drbd
</I>&gt;<i> 8.4, pacemaker 1.1.5 and corosync 1.4
</I>
&gt;<i> + drbd_update_master_score
</I>&gt;<i> + : == DEBUG == Secondary/UpToDate/UpToDate/ ==
</I>&gt;<i> + ocf_log err 'dk dk dk Secondary///'
</I>
Very ugly :(
Though it makes a difference whether you put ${X[*]//something} in
double quotes or not, so what you are logging there may be something
different from what is evaluated by the case statement.

Still, this is a bash bug.

I hope we can help bash a bit there,
by not substituting to an empty string,
like this:


diff --git a/scripts/drbd.ocf b/scripts/drbd.ocf
index 3277caa..b16148a 100644
--- a/scripts/drbd.ocf
+++ b/scripts/drbd.ocf
@@ -339,7 +339,7 @@ drbd_update_master_score() {
 	# For multi volume, we need to compare who is &quot;better&quot; a bit more sophisticated.
 	# The ${XXX[*]//UpToDate}, without being in double quotes, results in a single space,
 	# if all are UpToDate.
-	case ${DRBD_ROLE_LOCAL[*]}/${DRBD_DSTATE_LOCAL[*]//UpToDate}/${DRBD_DSTATE_REMOTE[*]//UpToDate}/ in
+	case ${DRBD_ROLE_LOCAL[*]}/${DRBD_DSTATE_LOCAL[*]//UpToDate/ }/${DRBD_DSTATE_REMOTE[*]//UpToDate/ }/ in
 	*Primary*/\ /*/)
 		# I am Primary, all local disks are UpToDate
 		set_master_score 10000


If that does not help,
we would need to completely code around that, and first do some
iterations over the various state arrays to gather &quot;global&quot; information,
then evaluate that in several if statements.

-- 
:<i> Lars Ellenberg
</I>:<i> LINBIT | Your Way to High Availability
</I>:<i> DRBD/HA support and consulting <A HREF="http://www.linbit.com">http://www.linbit.com</A>
</I>
DRBD&#174; and LINBIT&#174; are registered trademarks of LINBIT, Austria.
__
please don't Cc me, but send to list   --   I'm subscribed

</PRE>

<!--endarticle-->
    <HR>
    <P><UL>
        <!--threads-->
	<LI>Previous message: <A HREF="016536.html">[DRBD-user] DRBD 8.4 agent sets fallback master score 5
</A></li>
	<LI>Next message: <A HREF="016532.html">[DRBD-user] Deleting directories/files from drbd drive getting hung	for some time.
</A></li>
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#16541">[ date ]</a>
              <a href="thread.html#16541">[ thread ]</a>
              <a href="subject.html#16541">[ subject ]</a>
              <a href="author.html#16541">[ author ]</a>
         </LI>
       </UL>

<hr>
<a href="http://lists.linbit.com/mailman/listinfo/drbd-user">More information about the drbd-user
mailing list</a><br>
</body></html>
