Skip to content

Commit

Permalink
Merge pull request cyrusimap#4905 from cyrusimap/crc-logging
Browse files Browse the repository at this point in the history
Crc logging
  • Loading branch information
brong committed May 6, 2024
2 parents 86ef9d7 + f16a84f commit 6992fb4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 3 additions & 2 deletions imap/mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -3072,9 +3072,10 @@ EXPORTED int mailbox_commit(struct mailbox *mailbox)
if (config_auditlog && mailbox->modseq_dirty)
syslog(LOG_NOTICE, "auditlog: modseq sessionid=<%s> "
"mailbox=<%s> uniqueid=<%s> highestmodseq=<" MODSEQ_FMT
"> deletedmodseq=<" MODSEQ_FMT ">",
"> deletedmodseq=<" MODSEQ_FMT "> crcs=<%u/%u>",
session_id(), mailbox_name(mailbox), mailbox_uniqueid(mailbox),
mailbox->i.highestmodseq, mailbox->i.deletedmodseq);
mailbox->i.highestmodseq, mailbox->i.deletedmodseq,
mailbox->i.synccrcs.basic, mailbox->i.synccrcs.annot);

if (mailbox->modseq_dirty) {
struct mboxevent *mboxevent = mboxevent_new(EVENT_MAILBOX_MODSEQ);
Expand Down
7 changes: 6 additions & 1 deletion imap/sync_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -3122,8 +3122,13 @@ int sync_apply_mailbox(struct dlist *kin,
/* check the CRC too */
if (!r && !mailbox_crceq(synccrcs, mailbox_synccrcs(mailbox, 0))) {
/* try forcing a recalculation */
if (!mailbox_crceq(synccrcs, mailbox_synccrcs(mailbox, 1)))
if (!mailbox_crceq(synccrcs, mailbox_synccrcs(mailbox, 1))) {
xsyslog(LOG_NOTICE, "SYNCNOTICE: CRC error after apply",
"mailbox=<%s> crcs_master=<%u/%u> crcs_replica=<%u/%u>",
mailbox_name(mailbox), synccrcs.basic, synccrcs.annot,
mailbox->i.synccrcs.basic, mailbox->i.synccrcs.annot);
r = IMAP_SYNC_CHECKSUM;
}
}

mailbox_close(&mailbox);
Expand Down

0 comments on commit 6992fb4

Please sign in to comment.