mail-index-sync-update.c revision 02d6628c1fea2990c67c60b111c8e68867160885
893N/A/* Copyright (c) 2004-2016 Dovecot authors, see the included COPYING file */ 893N/A/* If we have less than this many bytes to sync from log file, don't bother 893N/A reading the main index */ 893N/A /* handling lost changes in view syncing */ 893N/A /* previous transaction was an extension introduction. 893N/A we probably came here from 893N/A mail_index_sync_ext_reset(). if there are any more 893N/A views which want to continue syncing it needs the 893N/A intro. so back up a bit more. 893N/A don't do this in case the last transaction in the 893N/A log is the extension intro, so we don't keep trying 893N/A to sync it over and over again. */ 893N/A /* different seen-flag */ 893N/A /* different deleted-flag */ 893N/A /* FIXME: does expunge handler's return value matter? 893N/A we probably shouldn't disallow expunges if the 893N/A handler returns failure.. should it be just changed 893N/A /* call expunge handlers only when syncing index file */ 893N/A /* call the expunge handlers first */ 893N/A /* @UNSAFE: move (prev_seq2+1) .. (seq1-1) to its 893N/A final location in the map if necessary */ 893N/A /* we'll return TRUE if this modseq change was written within the 893N/A transaction that was just committed */ "modseqs updated before they were enabled");
"Append with UID %u, but next_uid = %u",
/* move to memory. the mapping is written when unlocking so we don't waste time re-mmap()ing multiple times or waste space growing index /* the flags may have changed since it was added to map. use the updated flags already, so flag counters won't get /* don't rely on buffer->used being at the correct position. at least expunges can move it */ "Header update outside range: %u + %u > %u",
/* next_uid update tried to shrink its value. this can happen in some race conditions with e.g. with dsync, so just /* the tail offset updates are intended for internal transaction log handling. we'll update the offset in the header only when /* this is simply a request for expunge */ /* this is simply a request for expunge */ /* should be just extra padding */ /* name_size checked by _log_view_next() */ /* old versions have only new_reset_id */ "ext reset: invalid record size");
"ext hdr update: invalid record size");
"ext hdr update: invalid record size");
"Extension record updated " /* the record is padded to 32bits in the transaction log */ "ext rec update: invalid record size");
"Extension record updated " /* next sync finishes the deletion */ /* transaction log reading handles this */ "Unknown transaction record type 0x%x",
/* do we have dirty flags anymore? */ /* see if we'd prefer to reopen the index file instead of syncing the current map from the transaction log. don't check this if mmap is disabled, because reopening index causes sync to get lost. */ /* we don't know the index's size, so use the smallest index size we're willing to read */ /* this isn't necessary correct currently, but it should be /* if we failed because of a syscall error, make sure /* can't use it. sync by re-reading index. */ /* we're reading more from log than we would have preferred. remember that we probably want to rewrite index soon. */ /* view referenced the map. avoid unnecessary map cloning by unreferencing the map while view exists. */ /* if syncing updates the header, it updates hdr_copy_buf and updates hdr_base to hdr_copy_buf. so the buffer must initially contain a valid header or we'll break it when /* Reset the entire index. Leave only indexid and /* FIXME: when transaction sync lock is removed, we'll need to handle the case when a transaction is committed while mailbox is being synced ([synced transactions][new transaction][ext transaction]). this means int_offset contains [synced] and ext_offset contains /* this has been synced already. we're here only to call expunge handlers and extension update handlers. */ /* we'll just skip over broken entries */ /* transaction log tracks internally the current tail offset. besides using header updates, it also updates the offset to skip over following external transactions to avoid extra unneeded log /* restore refcount before closing the view. this is necessary also if map got cloned, because view closing would otherwise destroy it */ "Synchronization corrupted index header %s: %s",
/* make sure the index looks valid now */