<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body><div>On Thu, Jun 4, 2015, at 08:22 PM, Jean-Francois SMIGIELSKI wrote:<br></div>
<blockquote type="cite"><div style="direction:ltr;font-family:Tahoma;color:rgb(0, 0, 0);font-size:10pt;"><div>Hi!<br></div>
<div>&nbsp;</div>
<div>Yesterday I woked on integrating OpenIO as a Blob store for Cyrus. I<span style="font-size:13.3333px" class="size">&nbsp;t</span><span style="font-size:13.3333px" class="size">emporarily&nbsp;</span><span style="font-size:13.3333px" class="size">pushed my code in&nbsp;</span><a style="font-size:10pt;" href="https://github.com/jfsmig/oio-cyrus/tree/JFS-openio-integration">https://github.com/jfsmig/oio-cyrus/tree/JFS-openio-integration</a><span style="font-size:13.3333px" class="size">&nbsp;(the
 repository is a fork for your reference, on github for simplicity purposes). Because I sometimes fix and upgrade OpenIO in the same time, that code currently requires my own fork of OpenIO at&nbsp;</span><a style="font-size:10pt;" href="https://github.com/jfsmig/oio-sds.">https://github.com/jfsmig/oio-sds</a><br></div>
</div>
</blockquote><div>&nbsp;</div>
<div>I've added CC Raymond so he can take a look at this as well.&nbsp; He'll be working on Caringo and/or Ceph support, but it will want to be compatible with what you do.<br></div>
<div><br>Raymond, you missed out on a huge set of whiteboard work we did in Lille a few weeks ago!&nbsp; There are tons of different IO things happening in Cyrus.&nbsp; I'll see if I can find the photo :)<br></div>
<div>&nbsp;</div>
<blockquote type="cite"><div style="direction:ltr;font-family:Tahoma;color:rgb(0, 0, 0);font-size:10pt;"><div><span style="font-size:10pt" class="size">This is just a first iteration, managing the download from the blob store (in "mailbox_map_record") and the upload (in "mailbox_archive").</span><br></div>
<div><span style="font-size:10pt" class="size">Sorry, this is really a work in progress, not really clean (hardcoded configuration, etc).</span><br></div>
</div>
</blockquote><div>&nbsp;</div>
<div>Great!&nbsp; It's good to have progress :)&nbsp; That's definitely the right way to start.<br></div>
<div>&nbsp;</div>
<blockquote type="cite"><div style="direction:ltr;font-family:Tahoma;color:rgb(0, 0, 0);font-size:10pt;"><div><div>At this point, I raised a few questions. I didn't investigated yet around them, and I will do in further iterations. Anyway, any useful information will be appreciated :)<br></div>
<div>&nbsp;</div>
<div>* What is the preferred way to manage the configuration pour such a blob store module ? I typically need to provide a "namespace name", and maybe timeouts, etc. At present, this is hardcoded according to my test environment.<br></div>
</div>
</div>
</blockquote><div>&nbsp;</div>
<div>Mostly this is done with prefixed config options, for example sasl_* options get passed to the sasl engine.&nbsp; You would create openio_timeout, openio_namespace, etc in lib/imapoptions, and then in your code:<br></div>
<div>&nbsp;</div>
<div>struct openio_context *context = ...;<br></div>
<div>const char *ns = config_getstring(IMAPOPT_OPENIO_NAMESPACE);<br></div>
<div>openio_set_namespace(context, ns);<br></div>
<div>&nbsp;</div>
<div>or something like this (I haven't read your API at all, so I'm making stuff up)<br></div>
<div>&nbsp;</div>
<blockquote type="cite"><div style="direction:ltr;font-family:Tahoma;color:rgb(0, 0, 0);font-size:10pt;"><div><div>* What is the preferred way to keep a structured in cache? For each operation, I need a structure representing the OpenIO client. This structure has an&nbsp;<span style="font-size:13.3333px" class="size">internal</span><span style="font-size:10pt" class="size">&nbsp;cache (that
 takes time to load but greatly helps laters). At present, I create a new client for each operation.</span><br></div>
</div>
</div>
</blockquote><div>&nbsp;</div>
<div>Does that need to hold a socket open?&nbsp; One option would be to run a cyr_openiod or something, which clients talk to via a socket and have the daemon stay open handling requests to upload and download messages.<br></div>
<div>&nbsp;</div>
<div>Otherwise you can just create a global variable and store it there.&nbsp; See things like open_davdbs in the DAV code.&nbsp; We use refcounted global database lists quite a lot.<br></div>
<div>&nbsp;</div>
<blockquote type="cite"><div style="direction:ltr;font-family:Tahoma;color:rgb(0, 0, 0);font-size:10pt;"><div><div><span style="font-size:10pt" class="size">* I currently do poor error management, and later I will maybe need some tips about this. (e.g. what is the best behavior when the file is also missing on the blob store).</span><br></div>
</div>
</div>
</blockquote><div>&nbsp;</div>
<div>Return IMAP_IOERROR I guess :)<br></div>
<div>&nbsp;</div>
<blockquote type="cite"><div style="direction:ltr;font-family:Tahoma;color:rgb(0, 0, 0);font-size:10pt;"><div><div><span style="font-size:10pt" class="size">Last but not least, I currently meet a problem, and I cannot run a single test successfully.</span><br></div>
<div><span style="font-size:10pt" class="size">When used in cyrus, the libgridclient.so (from OpenIO) does not behave the same as when it is used in another standalone application.</span><br></div>
<div>E.g. When the OIO client receives and parses a reply for an internal RPC, the reply contains unexpected fields. This is a clue for bad memory management, and my best track for the moment.<br></div>
<div>I also experience troubles when trying to debug this. Is there some function overloading by cyrus ? (e.g. syslog, fprintf, etc)<br></div>
</div>
</div>
</blockquote><div>&nbsp;</div>
<div>There really shouldn't be.<br></div>
<div>&nbsp;</div>
<div>I'll see if I can get it running on my machine.&nbsp; Probably not tonight (nearly 11pm for me now), but soon.<br></div>
<div>&nbsp;</div>
<div>Bron.<br></div>
<div>&nbsp;</div>
<div id="sig567075"><div class="signature">--<br></div>
<div class="signature">Bron Gondwana<br></div>
<div class="signature">brong@fastmail.fm<br></div>
<div class="signature">&nbsp;</div>
</div>
<div>&nbsp;</div>
</body>
</html>