[Drbd-dev] Re: DRBD contribution

Azeez Ahamed azeez.ahamed at rediffmail.com
Thu May 1 10:42:29 CEST 2008


>Right. There should be no limit. The intention was to replace
>res->me and res->peer by a list. I guess this is what you have
>done, right?
>
Initially, i thought of implementing this way. This would require
changes in the code at many places. So, I have implemented in different
way with minimal impact. Logic i followed is

   1) Getting the value from the command line when -h <argument> is 
      specified. It will be stored in "peer_host" global variable.
   2) Added a new function called "find_peer_host()" in drbdadm_main.c 
      file. From adm_connect(), this new function is called with 
      res->all_hosts and "peer_host" as arguments to this new function.
      It will compare the "peer_host" value with the hosts->name. If 
      found,then returns the pointer to that host otherwise NULL.
   3) In adm_connect(), it is made sure that peer host will not be 
      local host and if -h option is not specified on the command line
      then the last 'on' section in the 'resource' is selected as 
      peer host. This logic can be improved by using DEFAULT keyword
      as you suggested below.

For reference, i will send the two files (drbdadm_parser.c and
drbdadm_main.c). Please go through the code and let me know if i am
going wrong anywhere.

>In case there is no '-h <peer-name>' option on the command line _AND_
>there are only two 'on' sections _AND_ on of the one sections matches
>my own local host name, then the peer is the other 'on' section.
>
 This is taken care in my code.

>In order to specify a default peer, there should be an additional
>keyword. E.g. "default". That keyword might only be specified in
>two of the 'on' sections.
>
I understood the above statement like this

  on node2 {
     device        /dev/drbd0;
     disk          /dev/loop0;
     address       10.1.40.37:1234;
     meta-disk     internal;
     default-peer  yes;   ---> new parameter added
  }

Is this way you are telling me to implement default peer host?


>I do not think it is a good idea to make the default selection
>dependend on the order of the sections in the config file, since
>we advise our users to use the same config file on all nodes of
>the cluster.
>

I think the above logic what i told will take care this also.

Thanks,
Azeez

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.linbit.com/pipermail/drbd-dev/attachments/20080501/cb629b5a/attachment.htm


More information about the drbd-dev mailing list