diff options
Diffstat (limited to 'storage/innobase/include/log0log.h')
-rw-r--r-- | storage/innobase/include/log0log.h | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/storage/innobase/include/log0log.h b/storage/innobase/include/log0log.h index 7e20fc12cda..f298b619107 100644 --- a/storage/innobase/include/log0log.h +++ b/storage/innobase/include/log0log.h @@ -70,15 +70,25 @@ void log_write_up_to(lsn_t lsn, bool durable, const completion_callback *callback= nullptr); /** Write to the log file up to the last log entry. -@param durable whether to wait for a durable write to complete */ -void log_buffer_flush_to_disk(bool durable= true); +@param durable whether to wait for a durable write to complete +@param wait whether to wait for completion +*/ +void log_buffer_flush_to_disk(bool durable= true, bool wait=true); + +/** Initiate log buffer write/flush */ +static inline void log_buffer_flush_to_disk_async() +{ + log_buffer_flush_to_disk(true, false); +} /** Prepare to invoke log_write_and_flush(), before acquiring log_sys.latch. */ ATTRIBUTE_COLD void log_write_and_flush_prepare(); -/** Durably write the log up to log_sys.get_lsn(). */ -ATTRIBUTE_COLD void log_write_and_flush(); +/** Durably write the log up to log_sys.get_lsn(). +@return lsn that log_write_up_to() must be invoked with +@retval 0 if there is no need to invoke log_write_up_to() */ +ATTRIBUTE_COLD __attribute__((warn_unused_result)) lsn_t log_write_and_flush(); /** Make a checkpoint */ ATTRIBUTE_COLD void log_make_checkpoint(); @@ -136,7 +146,8 @@ public: dberr_t close() noexcept; dberr_t read(os_offset_t offset, span<byte> buf) noexcept; - void write(os_offset_t offset, span<const byte> buf) noexcept; + void write(os_offset_t offset, span<const byte> buf, + tpool::aiocb *cb= nullptr) noexcept; bool flush() const noexcept { return os_file_flush(m_file); } #ifdef HAVE_PMEM byte *mmap(bool read_only, const struct stat &st) noexcept; @@ -485,8 +496,19 @@ public: /** Write buf to ib_logfile0. @tparam release_latch whether to invoke latch.wr_unlock() - @return the current log sequence number */ - template<bool release_latch> inline lsn_t write_buf() noexcept; + @param durable whether to invoke a durable write + @param sync whether to invoke a synchronous write + @return new write target + @retval 0 if there is no need to call log_write_up_to() */ + template<bool release_latch> + inline lsn_t write_buf(bool durable, bool sync) noexcept; + + /** Complete write_buf(). + @param lsn new value of write_lsn + @param durable whether the write was durable + @return new write target + @retval 0 if there is no need to call log_write_up_to() */ + inline lsn_t complete_write_buf(lsn_t lsn, bool durable) noexcept; /** Create the log. */ void create(lsn_t lsn) noexcept; |