<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body><blockquote><blockquote><blockquote type="cite"><div>- a single cyrus instance may be the primary server for some users but a
replica server for other users<br></div>
</blockquote><div>Are you sure about that? <br></div>
</blockquote><div>&nbsp;</div>
<div>I'm
 not sure about any of this.&nbsp; But you make a good point: I thought I 
could see a way that this was possible, but now I don't think I can.<br></div>
</blockquote><div>&nbsp;</div>
<div>I think I can, again, though I guess not in a murder.<br></div>
<div>&nbsp;</div>
<div>But in a non-murder setup, I believe the only difference between a primary vs replica is "which one the user interacts with"?&nbsp; Which, in a non-murder setup, one is presumably managing in some way external to cyrus (e.g. database, proxies, and some glue)...<br></div>
<div>&nbsp;</div>
<div>So it seems like it should be plausible to have two (or more) cyrus instances (hosted wherever), each running a sync_server plus a channel/sync_client for each of the others, and whatever happens on any replicates to the others.&nbsp; You'd be trusting your outer, non-cyrus layer to make sure not to proxy any individual user to the wrong instance (at least, not while there's pending replication transactions for them).&nbsp; And I guess shared folders would be thorny.&nbsp; But I don't (yet) see a reason from a replication standpoint why this wouldn't work.<br></div>
<div>&nbsp;</div>
<div>So:<br></div>
<div>&nbsp;</div>
<div>- a single cyrus instance may* be the primary server for some users but a
replica server for other users</div>
<div>&nbsp;</div>
<div>[* with caveats and requiring custom tooling, and specifically not in a murder]<br></div>
<div>&nbsp;</div>
<div>ellie<br></div>
<div>&nbsp;</div>
<div>On Fri, Jul 24, 2015, at 10:01 AM, ellie timoney wrote:<br></div>
<blockquote type="cite"><pre><br></pre><blockquote><div>Okay, I'll bite.&nbsp; Here's what a bit of a sync_log looks like:<br></div>
</blockquote><div>&nbsp;</div>
<div>Thanks!&nbsp; So anything processing a sync_log (sync_client, squatter, etc) needs to look at an actual copy of the user/mailbox in order to determine its current state, and needs to look at both copies to work out what to replicate between them.<br></div>
<div>&nbsp;</div>
<blockquote><blockquote type="cite"><div>- a single cyrus instance may be the primary server for some users but a
replica server for other users<br></div>
</blockquote><div>Are you sure about that? <br></div>
</blockquote><div>&nbsp;</div>
<div>I'm not sure about any of this.&nbsp; But you make a good point: I thought I could see a way that this was possible, but now I don't think I can.<br></div>
<div>&nbsp;</div>
<div>Cheers,<br></div>
<div>&nbsp;</div>
<div>ellie<br></div>
<div>&nbsp;</div>
<div>On Thu, Jul 23, 2015, at 11:42 PM, Nic Bernstein wrote:<br></div>
<blockquote type="cite"><div>On 07/23/2015 01:14 AM, ellie timoney wrote:<br></div>
<blockquote cite="mid:1437632078.1806425.330925921.3A2B9A7D@webmail.messagingengine.com" type="cite"><blockquote type="cite" style="color:rgb(0, 0, 0);"><pre>Is the file format of the sync log defined anywhere? I assume it
<span>&gt; </span>correlates with a set of commands. (Not that this is important to a
<span>&gt; </span>user: it may as well be opaque, but it made me wonder!)<br></pre></blockquote><pre>I'm a bit confused about this myself.  Each time I go digging into the
code my understanding flips back the opposite way.

I think, either:

* the sync log contains all the information needed to reproduce what's
happened (e.g. if a message has arrived, the sync log will contain the
message itself); OR
* the sync log contains just enough to identify things that have changed
(e.g. if a message has arrived, the sync log contains a message id of
some sort), and the sync_client processing the log just uses the log to
discover which things to sync, but then uses the actual mailbox to
construct the changes to send to the replica.

Either way I haven't seen any documentation on the sync log format.  I
suspect it's either the raw sync protocol or some subset thereof?<br></pre></blockquote><div>&nbsp;</div>
<div>Okay, I'll bite.&nbsp; Here's what a bit of a sync_log looks like:<br></div>
<blockquote><pre>MAILBOX user.newjersey
MAILBOX user.support
USER onlight
USER nic
USER admin
USER randy
MAILBOX user.randy.Trash
USER lynn
MAILBOX user.lynn.Trash<br></pre></blockquote><div>It's basically a list of either users or mailboxes which have been
    altered.&nbsp; When sync_log is enabled, all of the daemons which might
    alter a mailbox or user will write a line to this log each time they
    do so.&nbsp; That means the obvious suspects -- imapd, pop3d, timsieved,
    lmtpd, etc. -- but also cyr_expire and friends (as in the
    USER...MAILBOX couplets at the end of the sample).<br></div>
<div>&nbsp;</div>
<blockquote type="cite"><pre>- a single cyrus instance may be the primary server for some users but a
replica server for other users<br></pre></blockquote><div>Are you sure about that?&nbsp; How does one specify the users for which
    such an instance would play each role?&nbsp; A single HOST may run
    separate instances, which may perform these different roles, but I
    cannot fathom how to configure a single instance to do both at once
    for different user cohorts.<br></div>
<div>&nbsp;</div>
<div>This raises potential problems when one deploys replication within a
    murder (Cyrus aggregation).&nbsp; Only one server may claim ownership of
    any given mailbox, via a mupdate call, so an instance which is a
    replica MAY NOT push updates to mupdate master, or mayhem will
    ensue.&nbsp; Here's a commented section from /etc/cyrus.conf on a
    replication master instance:<br></div>
<pre>##
        # Master sends mailbox updates to mupdate.
        # Replication client runs on Master.
        # Comment these 2 lines out on replicas
        mupdatepush                cmd="/usr/lib/cyrus/bin/ctl_mboxlist -m"
        syncclient                cmd="/usr/lib/cyrus/bin/sync_client -r"<br></pre><div>A nice daydream of mine envisions a world wherein mailboxes.db keeps
    track of replica locations, as well, which would allow for the
    dual-role operation Ellie describes.<br></div>
<div>&nbsp;</div>
<div>Cheers,<br></div>
<div>&nbsp;&nbsp;&nbsp; -nic<br></div>
<pre>-- 
Nic Bernstein                             <a href="mailto:nic@onlight.com">nic@onlight.com</a>
Onlight llc.                              <a href="http://www.onlight.com">www.onlight.com</a>
219 N. Milwaukee St., Ste. 2A                  v. 414.272.4477
Milwaukee, Wisconsin  53202                  f. 414.290.0335<br></pre></blockquote><div>&nbsp;</div>
</blockquote><div>&nbsp;</div>
</body>
</html>