[Pacemaker] Can't failover Master/Slave with group(primitive x3) setting

Junko IKEDA tsukishima.ha at gmail.com
Mon Oct 10 22:21:06 EDT 2011


Hi,

>   https://github.com/beekhof/pacemaker/commit/3312b9e

It seems that this changeset works fine to our problems,
Thank you!

Regards,
Junko

>> I'm not 100% sure I like this patch but could you see how it behaves
>> in your testing?
>
> Or if it helps:
>   https://github.com/beekhof/pacemaker/commit/3312b9e
>
> (The beekhof repo is my private playground for things that may not yet
> be ready for the ClusterLabs tree)
>
>>
>>
>> diff --git a/pengine/native.c b/pengine/native.c
>> index 52f6f0f..8718abb 100644
>> --- a/pengine/native.c
>> +++ b/pengine/native.c
>> @@ -26,6 +26,7 @@
>>  #include <utils.h>
>>
>>  #define DELETE_THEN_REFRESH 1   /* The crmd will remove the resource
>> from the CIB itself, making this redundant */
>> +#define INFINITY_HACK   (INFINITY * -100)
>>
>>  #define VARIANT_NATIVE 1
>>  #include <lib/pengine/variant.h>
>> @@ -287,8 +288,12 @@ node_hash_update(GHashTable * list1, GHashTable *
>> list2, const char *attr, int f
>>             crm_trace("%s: Filtering %d + %d*%d (factor * score)",
>>                       node->details->uname, node->weight, factor, score);
>>
>> +        } else if (node->weight == INFINITY_HACK) {
>> +            crm_trace("%s: Filtering %d + %d*%d (node < 0)",
>> +                      node->details->uname, node->weight, factor, score);
>> +
>>         } else if (only_positive && new_score < 0 && node->weight > 0) {
>> -            node->weight = 1;
>> +            node->weight = INFINITY_HACK;
>>             crm_trace("%s: Filtering %d + %d*%d (score > 0)",
>>                       node->details->uname, node->weight, factor, score);
>>
>> @@ -300,7 +305,6 @@ node_hash_update(GHashTable * list1, GHashTable *
>> list2, const char *attr, int f
>>             crm_trace("%s: %d + %d*%d", node->details->uname,
>> node->weight, factor, score);
>>             node->weight = new_score;
>>         }
>> -
>>     }
>>  }
>>
>> @@ -405,6 +409,17 @@ rsc_merge_weights(resource_t * rsc, const char
>> *rhs, GHashTable * nodes, const c
>>
>>     }
>>
>> +    if(is_set(flags, pe_weights_positive)) {
>> +        node_t *node = NULL;
>> +        GHashTableIter iter;
>> +        g_hash_table_iter_init(&iter, work);
>> +        while (g_hash_table_iter_next(&iter, NULL, (void **)&node)) {
>> +            if (node->weight == INFINITY_HACK) {
>> +                node->weight = 1;
>> +            }
>> +        }
>> +    }
>> +
>>     if (nodes) {
>>         g_hash_table_destroy(nodes);
>>     }
>>
>
> _______________________________________________
> Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
> http://oss.clusterlabs.org/mailman/listinfo/pacemaker
>
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs: http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker
>




More information about the Pacemaker mailing list