unexpunge+replication behaviour

Bron Gondwana brong at fastmail.fm
Thu Sep 27 20:07:14 EDT 2007


On Thu, Sep 27, 2007 at 02:17:05PM -0400, Wesley Craig wrote:
> This is a very simple bug: ipurge is not logging a sync event.  The  
> fix is to add sync_log_mailbox (or something similar) if ipurge makes  
> a change.  I suspect that unexpunge is suffering from a similar  
> problem, but I haven't actually looked, so it may be more complex.

Yeah, it's more complex.  The sync protocol doesn't check UIDVALIDITY
at all, it works purely with UIDs, and if a deleted UID re-appears,
it doesn't notice and remove it from cyrus.expunge, meaning the same
record is present in both cyrus.index and cyrus.expunge.

ipurge, yes, that's just a missing sync event.  It would probably
look something like this (I've added this to my local patch set)

Index: cyrus-imapd-2.3.9/imap/ipurge.c
===================================================================
--- cyrus-imapd-2.3.9.orig/imap/ipurge.c	2007-09-28 10:02:47.000000000 +1000
+++ cyrus-imapd-2.3.9/imap/ipurge.c	2007-09-28 10:04:16.000000000 +1000
@@ -67,6 +67,7 @@
 #include "mailbox.h"
 #include "xmalloc.h"
 #include "mboxlist.h"
+#include "sync_log.h"
 
 /* config.c stuff */
 const int config_need_data = CONFIG_NEED_PARTITION_DATA;
@@ -270,6 +271,8 @@
   mailbox_expunge(&the_box, purge_check, &stats, EXPUNGE_FORCE);
   mailbox_close(&the_box);
 
+  sync_log_mailbox(name);
+
   print_stats(&stats);
 
   return 0;


More information about the Info-cyrus mailing list