Thanks for your clear explanation. Now I understand why I couldn't find any specific code for that inside sync_server.
I was looking for a way to somehow multiplex the replication stream for unrelated stuff and reduce the delay between master and our non-cyrus sync_server implementation. With 3.0 is it possible to get a replication log & stream per partition instead of one per server ? Thomas. On Mon, Jan 30, 2017 at 11:16 PM, ellie timoney via Cyrus-devel < cyrus-devel@lists.andrew.cmu.edu> wrote: > Hi Thomas, > > Your understanding of the imap / sync relationship is backwards: it's not > that sync_server now understands imap-style commands with tags, but rather > that imapd can now act as a sync destination. > > Specifically, imapd now supports SYNCAPPLY, SYNCGET and SYNCRESTART > commands, which correspond respectively with the APPLY, GET and RESTART > commands supported by sync_server. (You must be authenticated as an admin > for these commands to be available.) > > When sync_client connects to the specified port, it doesn't know whether > the remote end is a sync_server or an imapd. The sync_try_imap setting is > used to control whether it tries to use IMAP protocol or not. When set to > "yes" (the default), it will send the C01 CAPABILITY as you observed. > > *If the remote end is imapd, this will succeed, and replication will > proceed using the IMAP style protocol. > * If the remote end is sync_server, it will return a protocol error (as > you observed) since it doesn't support the IMAP protocol. In this case, > sync_client will then fall back to using the CSYNC protocol, and > replication will proceed. > > If sync_try_imap is set to "no", then sync_client will not try the IMAP > protocol at all -- it will just proceed directly to CSYNC. > > The default setting will support replicating to either sync_server or > imapd. If you don't intend to use imapd for replication, you can speed up > the initial connection by disabling sync_try_imap. > > Cheers, > > ellie > > On Tue, Jan 31, 2017, at 02:07 AM, Thomas Cataldo via Cyrus-devel wrote: > > Hi, > > I have some questions about sync_server protocol regarding the > sync_try_imap option. > > When trying a git build of cyrus 3, sync_client begins its dialog with the > sync_server with a : > > C01 CAPABILITY > > > I understand what the answer should be to this capability request, I issue > the same command to a cyrus 3 sync_server and here is what I get : > > root@bm1604:~# telnet localhost 2500 > > Trying ::1... > > Trying 127.0.0.1... > > Connected to localhost. > > Escape character is '^]'. > > * SASL PLAIN > > * STARTTLS > > * COMPRESS DEFLATE > > * OK bm1604 Cyrus sync server 3.0.0-rc1-70-gd12e571 > > C01 CAPABILITY > > BAD IMAP_PROTOCOL_ERROR Unrecognized command > > > So my question is whether the master branch really supports an imap like > variant of the replication protocol. If it does, I would like to know how > to enable it. > > What I expect is that with tagged commands, the replication could > multiplex some of its operations. > > eg. when 2 mailboxes are changed, it could issue : > > M01 APPLY MAILBOX %(...) > > M02 APPLY MAILBOX %(...) > > without waiting for the response to M01. > > > Regards, > > Thomas. > > > >