return log_buffer_move_to_memory(ctx);
}
- i_assert(!ctx->sync_includes_this ||
- file->sync_offset + ctx->output->used ==
- file->max_tail_offset);
-
if ((ctx->want_fsync &&
file->log->index->set.fsync_mode != FSYNC_MODE_NEVER) ||
file->log->index->set.fsync_mode == FSYNC_MODE_ALWAYS) {
ctx->output->used);
}
file->sync_offset += ctx->output->used;
+ if (ctx->sync_includes_this)
+ file->max_tail_offset = file->sync_offset;
return 0;
}
buffer_t buf;
unsigned char update_data[sizeof(*u) + sizeof(offset)];
+ offset = file->max_tail_offset;
if (!ctx->index_sync_transaction) {
/* this is a non-syncing transaction. update the tail offset
only if we're already writing something else to transaction
can't rely on this. then write non-changed offset + check
real offset + rewrite the new offset if other transactions
weren't written in the middle */
- file->max_tail_offset += ctx->output->used +
+ offset = file->max_tail_offset + ctx->output->used +
sizeof(*hdr) + sizeof(*u) + sizeof(offset);
ctx->sync_includes_this = TRUE;
} else {
we may need to update the tail offset even if we don't have
anything else to do. */
}
- offset = file->max_tail_offset;
if (file->last_read_hdr_tail_offset == offset)
return;