From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simone Gotti Date: Fri, 27 Apr 2007 17:57:16 +0200 Subject: [Cluster-devel] [RFC][PATCH] Unique resource name handling for rgmanager. Message-ID: <1177689436.4027.49.camel@localhost> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi all, starting from the clarification quoted from lon in bug 229650: "instances of shared resources are expected to be able to operate independently. That is, if one instance fails, it does not imply that they all have failed. If it does, something is broken in the resource agent and/or rgmanager. If it isn't possible to make the resource instances completely independent of one-another, then the resource agent should not define maxinstances > 1." and thinking of a future ability of rgmanager to manage in the detail a single resource inside a resource group I noticed some things: *) restree.c:_res_op walks all the resource tree (so also resources owned by another rg_thread) and starts working on the resource passed with parameter "first". This now isn't a problem as _res_op is called passing always to it, as parameter first, the service name. But for example with rg_test you can test the stop/start/etc.. of a resource inside a resource group. In this case, if I call for example "rg_test test /etc/cluster/cluster.conf stop clusterfs gfs01" and gfs01 has multiple instances on the same machine it will stop all the resources of type gfs01 without the ability to stop only the one I want to. *) For the fact that now in the upper layer of the resource tree I can also put a resource that it's not of type service I can have multiple instances of it in the upper layer. So, trying to leave unchanged the behavior of _res_op (i changed its parameters anyway...) I (with the help of Lon on IRC) thinked: 1) Make possible to start/stop just 1 instance of a multiple instance resource => call it with an unique name. 2) Implement this way to call the resource inside rgmanager. This means that I'm going to work directly on the resource_node_t (and the resource it points to) and not to a general resource_t that can be found multiple times in the tree. I did a basic example patch that needs a lot of work just to share it with you and talk all togheter on its implementation. The resource's unique name generation should be changed without changing all the other code that use it and now it's in this format: $TYPE:$PRIMARYATTRVALUE[$INSTANCENUMBER] where $INSTANCENUMBER is optional if the resource type doesn't support multiple instances or only one multiple instances resource exists with the cluster. for example 2 instances of clusterfs:gfs01 will be called clusterfs:gfs01[0] and clusterfs:gfs01[1]. This kind of naming isn't unique as if I change the cluster.conf the $INSTANCENUMBER can change but I'll be able to know its new name for example with rg_test. Sorry for the long mail but I hope that everythings is clear. Thanks! Bye! -- Simone Gotti -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: La Cronaca del Carnevale di Ivrea 2007 visto su www.localport.it: per conoscere il Carnevale, per rivivere l?edizione 2007. Acquistalo on line Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=6431&d=27-4 -------------- next part -------------- A non-text attachment was scrubbed... Name: rgmanager-cvsHEAD-res_operations-basicexample01.patch Type: text/x-patch Size: 20576 bytes Desc: not available URL: