# HG changeset patch # User Timo Sirainen # Date 1101328895 -7200 # Node ID e7d6ae64fd68ea3d9785af3f98bbe836aca71836 # Parent fd431866c674382fca82780693e9f1f1477fd79b When committing transaction, don't do index locking unless we really want to try rotating the log file. diff -r fd431866c674 -r e7d6ae64fd68 src/lib-index/mail-transaction-log.c --- a/src/lib-index/mail-transaction-log.c Wed Nov 24 22:40:39 2004 +0200 +++ b/src/lib-index/mail-transaction-log.c Wed Nov 24 22:41:35 2004 +0200 @@ -1224,19 +1224,19 @@ } } - if (mail_index_lock_shared(log->index, TRUE, &lock_id) < 0) { - if (!log->index->log_locked) - mail_transaction_log_file_unlock(log->head); - return -1; - } - idx_hdr = *log->index->hdr; - mail_index_unlock(log->index, lock_id); - if (log->head->sync_offset > MAIL_TRANSACTION_LOG_ROTATE_SIZE && log->head->last_mtime < ioloop_time - MAIL_TRANSACTION_LOG_ROTATE_MIN_TIME) { /* we might want to rotate, but check first that everything is synced in index. */ + if (mail_index_lock_shared(log->index, TRUE, &lock_id) < 0) { + if (!log->index->log_locked) + mail_transaction_log_file_unlock(log->head); + return -1; + } + idx_hdr = *log->index->hdr; + mail_index_unlock(log->index, lock_id); + if (log->head->hdr.file_seq == idx_hdr.log_file_seq && log->head->sync_offset == idx_hdr.log_file_int_offset && log->head->sync_offset == idx_hdr.log_file_ext_offset) {