<p dir="ltr">Resending to mailing list. </p>
<p dir="ltr">---------- Forwarded message ----------<br>
From: &quot;Kaushal M&quot; &lt;<a href="mailto:kshlmster@gmail.com">kshlmster@gmail.com</a>&gt;<br>
Date: 03-Aug-2015 10:12<br>
Subject: Re: [Gluster-devel] RPC thoughts for glusterd-2.0<br>
To: &quot;chris holcombe&quot; &lt;<a href="mailto:chris.holcombe@canonical.com">chris.holcombe@canonical.com</a>&gt;<br>
Cc: &quot;Krishnan Parthasarathi&quot; &lt;<a href="mailto:kparthas@redhat.com">kparthas@redhat.com</a>&gt;</p>
<p dir="ltr">&gt; Hi Chris,<br>
&gt;<br>
&gt; In GlusterD-2.0, all the gluster command endpoints will be RESTful<br>
&gt; http api. The gluster cli itself will be a REST client. This should<br>
&gt; allow for easier and better integration for external consumers. We&#39;ve<br>
&gt; not yet fleshed out the api for all the commands yet. We&#39;ve started<br>
&gt; off with Heketi&#39;s api, which already has it designed for volume<br>
&gt; creation, deletion and listing, and for cluster growth.<br>
&gt;<br>
&gt; While the REST api is useful for external consumers, we think it&#39;s not<br>
&gt; the most suitable method for doing internal communication within the<br>
&gt; cluster. This is the communication between GlusterD and other<br>
&gt; GlusterDs, bricks, clients etc. We are looking for a good RPC<br>
&gt; framework with libraries for Go and C. There are not a lot around.<br>
&gt; We&#39;ve looked at 3 so far.<br>
&gt;<br>
&gt; 1. gRPC - This is really interesting and provides a lot of features.<br>
&gt; But this is currently in alpha and also requires the use of protobuf3,<br>
&gt; which itself is in alpha.<br>
&gt; 2. Apache Thrift - The C implementation requires the use of Glib,<br>
&gt; which we are not comfortable with and feel is a little too much for<br>
&gt; what we need.<br>
&gt; 3. Json-rpc - This works wonderfully well with Go. But requires a lot<br>
&gt; of manual boiler-plate code writing for C to do the serialization and<br>
&gt; deserialization.<br>
&gt;<br>
&gt; We could implement our own sunrpc for Go using go-xdr, but one<br>
&gt; drawback is that, we don&#39;t have code generation for Go from .x files.<br>
&gt; This requires us to manually write the request and response structs.<br>
&gt;<br>
&gt; We&#39;re currently looking at writing our own simple RPC framework using<br>
&gt; protobuf2 for data serialization. Protobuf has a couple of advantages<br>
&gt; over XDR. It&#39;s got code-generators for Go and C, and protobuf<br>
&gt; serialized structs are forwards and backwards compatible. Either KP or<br>
&gt; I will be sharing details regarding this soon.<br>
&gt;<br>
&gt; If you&#39;ve got any suggestion, please let us know.<br>
&gt;<br>
&gt; And thanks for showing interest in GlusterD-2.0!<br>
&gt;<br>
&gt; Cheers,<br>
&gt; Kaushal<br>
&gt;<br>
&gt;<br>
&gt; On Fri, Jul 31, 2015 at 11:13 PM, Atin Mukherjee<br>
&gt; &lt;<a href="mailto:atin.mukherjee83@gmail.com">atin.mukherjee83@gmail.com</a>&gt; wrote:<br>
&gt; &gt; -Atin<br>
&gt; &gt; Sent from one plus one<br>
&gt; &gt; On Jul 31, 2015 10:57 PM, &quot;chris holcombe&quot; &lt;<a href="mailto:chris.holcombe@canonical.com">chris.holcombe@canonical.com</a>&gt;<br>
&gt; &gt; wrote:<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Thanks!  I&#39;d like to contribute if I can.  I found a go xdr library:<br>
&gt; &gt;&gt; <a href="https://github.com/davecgh/go-xdr">https://github.com/davecgh/go-xdr</a><br>
&gt; &gt;&gt; That should be enough to get the sun rpc stuff working.  :)<br>
&gt; &gt; +KP,kaushal - this may reduce our effort?<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; On 07/31/2015 10:26 AM, Atin Mukherjee wrote:<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; Thanks Chris for your mail.<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; We&#39;ve started exploring different RPC techniques as we plan to write<br>
&gt; &gt;&gt;&gt; glusterd 2.0 in go and it seems like go doesn&#39;t have sun RPC library<br>
&gt; &gt;&gt;&gt; support. All the details will be put up once we share the glusterd 2.0 high<br>
&gt; &gt;&gt;&gt; level plan.<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; Having said that, we&#39;d definitely consider your points in terms of<br>
&gt; &gt;&gt;&gt; designing it. Also any form of contribution for glusterd 2.0 Is more than<br>
&gt; &gt;&gt;&gt; welcome :)<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; -Atin<br>
&gt; &gt;&gt;&gt; Sent from one plus one<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; On Jul 31, 2015 10:43 PM, &quot;chris holcombe&quot; &lt;<a href="mailto:chris.holcombe@canonical.com">chris.holcombe@canonical.com</a>&gt;<br>
&gt; &gt;&gt;&gt; wrote:<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt; I&#39;ve been working on writing a gluster library that speaks the native<br>
&gt; &gt;&gt;&gt;&gt; RPC to gluster so that I could avoid using the CLI.  I&#39;ve been successful<br>
&gt; &gt;&gt;&gt;&gt; but the endeavor has brought up some interesting insights.  I plan on open<br>
&gt; &gt;&gt;&gt;&gt; sourcing the code so that everyone can benefit from this.<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt; struct gf_cli_req {<br>
&gt; &gt;&gt;&gt;&gt;         opaque  dict&lt;&gt;;<br>
&gt; &gt;&gt;&gt;&gt; };<br>
&gt; &gt;&gt;&gt;&gt; and<br>
&gt; &gt;&gt;&gt;&gt; struct gf_cli_rsp {<br>
&gt; &gt;&gt;&gt;&gt;         int     op_ret;<br>
&gt; &gt;&gt;&gt;&gt;         int     op_errno;<br>
&gt; &gt;&gt;&gt;&gt;         string  op_errstr&lt;&gt;;<br>
&gt; &gt;&gt;&gt;&gt;         opaque  dict&lt;&gt;;<br>
&gt; &gt;&gt;&gt;&gt; };<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt; are used to make a lot of the CLI calls. The opaque dict passing back<br>
&gt; &gt;&gt;&gt;&gt; and forth creates a need for string parsing on both sides.  My understanding<br>
&gt; &gt;&gt;&gt;&gt; of RPC was that each call would have its own struct associated with it so<br>
&gt; &gt;&gt;&gt;&gt; that no parsing need happen.  It would also make it much easier for other<br>
&gt; &gt;&gt;&gt;&gt; people to build libraries to interface with Gluster if the call parameters<br>
&gt; &gt;&gt;&gt;&gt; were clearly defined.  Each time I want to make a call work with glusterd<br>
&gt; &gt;&gt;&gt;&gt; 1.0 I need to figure out what parameters need to be packed into the dict.<br>
&gt; &gt;&gt;&gt;&gt; This involves some hunting.<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt; Since glusterd 2.0 is a refactoring I figured this would be a good time<br>
&gt; &gt;&gt;&gt;&gt; to ask for adding additional more explicit RPC calls to the API.  That would<br>
&gt; &gt;&gt;&gt;&gt; make it a breeze to run an rpcgen command against the .x file and have a<br>
&gt; &gt;&gt;&gt;&gt; working library to glusterd!<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt; Thanks,<br>
&gt; &gt;&gt;&gt;&gt; Chris<br>
&gt; &gt;&gt;&gt;&gt; _______________________________________________<br>
&gt; &gt;&gt;&gt;&gt; Gluster-devel mailing list<br>
&gt; &gt;&gt;&gt;&gt; <a href="mailto:Gluster-devel@gluster.org">Gluster-devel@gluster.org</a><br>
&gt; &gt;&gt;&gt;&gt; <a href="http://www.gluster.org/mailman/listinfo/gluster-devel">http://www.gluster.org/mailman/listinfo/gluster-devel</a><br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;<br>
</p>