sync_server do_rename() and uidvalidity

David Carter dpc22 at cam.ac.uk
Sun Jan 15 05:29:40 EST 2012


I've just noticed some noise in my logs which appear to be a consequence 
of me clearing out a whole collection of old mailboxes:

   Jan 14 20:49:16 cyrus-38 sync_client[23990]:
      SYNCNOTICE: uidvalidity higher on replica
         DELETED.user.dpc22.cron-sep-2010.4F0F524C,
         updating 1326404172 => 1326404173

The cause is mailbox_rename_copy():

     /* update uidvalidity */
     newmailbox->i.uidvalidity = time(0);

where the replica has been updated one second after the master by the 
do_rename() function in sync_server.

I use the replication engine for nightly backups to an archive server as 
well as rolling replication. This means that three different uidvalidity 
values can be in play. Here's the same mailbox after a nightly backup. 
Uidvalidity has been bounced for a second time on the master:

   Jan 14 22:46:58 cyrus-38 sync_client[24693]:
      SYNCNOTICE: uidvalidity higher on replica
        DELETED.user.dpc22.cron-sep-2010.4F0F524C,
        updating 1326404173 => 1326581090

mbexamine demonstrates that I've ended up with a uidvalidity of 1326581090 
on the master and backup servers, and 1326404173 on the replica for this 
particular mailbox. The replica isn't fixed by "sync_client -u".

I guess that a workaround would be for mailbox_rename_copy() to copy the 
uidvalidity value from the old mailbox to the new. This would correspond 
to what my old 2.3 FAST_RENAME patch used to do, just moving all of the 
cyrus index, cache and messages files with a single rename(). There is a 
small danger that an IMAP client might confuse two mailboxes with the same 
uidvalidity following a particularly unfortunate collection of renames, 
although this has never been a problem for us in seven or eight years now.

Any other ideas? I'm happy to write this up as a bugzilla entry, I'm just 
debating what to put in that report. I am running Cyrus 2.4.13.

-- 
David Carter                             Email: David.Carter at ucs.cam.ac.uk
University Computing Service,            Phone: (01223) 334502
New Museums Site, Pembroke Street,       Fax:   (01223) 334679
Cambridge UK. CB2 3QH.


More information about the Cyrus-devel mailing list