[sheepdog] [PATCH v3 2/3] lib: move sockfd cache from sheep to lib

Hitoshi Mitake mitake.hitoshi at gmail.com
Wed Jul 24 16:36:19 CEST 2013


At Sat, 20 Jul 2013 00:29:51 +0800,
Liu Yuan wrote:
> 
> On Sat, Jul 20, 2013 at 12:38:42AM +0900, Hitoshi Mitake wrote:
> > At Fri, 19 Jul 2013 23:27:02 +0800,
> > Liu Yuan wrote:
> > > 
> > > On Sat, Jul 20, 2013 at 12:24:18AM +0900, Hitoshi Mitake wrote:
> > > > At Fri, 19 Jul 2013 23:21:54 +0800,
> > > > Liu Yuan wrote:
> > > > > 
> > > > > On Sat, Jul 20, 2013 at 12:14:33AM +0900, Hitoshi Mitake wrote:
> > > > > > At Fri, 19 Jul 2013 20:31:57 +0800,
> > > > > > Liu Yuan wrote:
> > > > > > > 
> > > > > > > On Fri, Jul 19, 2013 at 03:18:23PM +0900, Hitoshi Mitake wrote:
> > > > > > > > On some subcommands, collie also issues lots of request to sheeps. So
> > > > > > > > collie can enjoy sockfd caching. For this purpose, this patch moves
> > > > > > > > sockfd from sheep to lib and generalize the interfaces of sockfd.
> > > > > > > > 
> > > > > > > > This patch doesn't change anything related to IO nic in sockfd
> > > > > > > > cache. Because collie can know address nad port of IO nic and
> > > > > > > > potentially use them.
> > > > > > > 
> > > > > > > I think you should strip out node management code. Only sheep daemon need to
> > > > > > > manage node.
> > > > > > 
> > > > > > What does "node management code" mean? sockfd_node_del() and
> > > > > > sockfd_cache_add_group()?
> > > > > 
> > > > > Yes, only sheep needs these code.
> > > > 
> > > > OK, I agree. I'll move them to sheep again in v4.
> > > 
> > > Well, seems you need to add nodes in collie too? I didn't see the code in collie
> > > to add nodes to sockfd cache.
> > 
> > For now, sockfd_cache_get() and sockfd_cache_put() would be enough for
> > collie. sockfd_cache_add() seems to be in sheep, too.
> > 
>  
> If you sockfd_cache_add(connected node), then I think you don't need
> collie_exec_req_nid()

As you say, collie_exec_req_nid() can be removed. I'll remove this in v4.

Thanks,
Hitoshi



More information about the sheepdog mailing list