[PATCH] ctdb: show lmaster in ctdb cat[t]db

Martin Schwenke martin at meltin.net
Wed Sep 12 13:00:03 UTC 2018


On Wed, 12 Sep 2018 14:05:36 +0200, Ralph Böhme <slow at samba.org> wrote:

> On Wed, Sep 12, 2018 at 10:56:06AM +1000, Amitay Isaacs wrote:
> >On Tue, Sep 11, 2018 at 4:24 PM, Ralph Böhme <slow at samba.org> wrote:  
> >> Would this be useful upstream?  
> >
> >It's a good idea in general.
> >  
> >>
> >> Patch attached, please review & push if happy.
> >>  
> >
> >The logic for calculation of lmaster is a bit more involved than using
> >the number of nodes in the cluster.
> >
> >The nodes can be inactive, in which case they have be ignored from the
> >lmaster calculation.
> >Also, nodes can be deleted so, nodemap might have holes.
> >
> >As a first approximation the patch will produce the correct output in
> >most scenarios, but I would prefer it not generate wrong output at any
> >time.  
> 
> oh, good point, thanks. :)
> 
> I tried using ctdb_lmaster() from common, but it seems it is not really usable 
> from outside of server.
> 
> *scratches head*

Probably use ctdb_ctrl_getvnnmap() to retrieve a VNN map.  To see the
bits you need, look at the example in control_status() and
print_status() (in ctdb/tools/ctdb.c).  I doubt that you'll be able to
use ctdb_hash() and ctdb_lmaster() directly, because they drag in old
stuff that we don't want, but they'll give you the bits that you can
re-use in the lmaster calculation.

I hope that helps... and that I haven't put you on the wrong
track...  :-)

peace & happiness,
martin



More information about the samba-technical mailing list