summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--storage/innobase/log/log0log.cc26
1 files changed, 8 insertions, 18 deletions
diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc
index fdc47a8d442..1a8786c3c26 100644
--- a/storage/innobase/log/log0log.cc
+++ b/storage/innobase/log/log0log.cc
@@ -91,27 +91,17 @@ should be bigger than LOG_POOL_PREFLUSH_RATIO_SYNC */
the previous */
#define LOG_POOL_PREFLUSH_RATIO_ASYNC 8
-/****************************************************************//**
-Returns the oldest modified block lsn in the pool, or log_sys.lsn if none
-exists.
+/** Return the oldest modified LSN in buf_pool.flush_list,
+or the latest LSN if all pages are clean.
@return LSN of oldest modification */
-static
-lsn_t
-log_buf_pool_get_oldest_modification(void)
-/*======================================*/
+static lsn_t log_buf_pool_get_oldest_modification()
{
- lsn_t lsn;
-
- ut_ad(log_mutex_own());
-
- lsn = buf_pool_get_oldest_modification();
+ ut_ad(log_mutex_own());
+ log_flush_order_mutex_enter();
+ lsn_t lsn= buf_pool_get_oldest_modification();
+ log_flush_order_mutex_exit();
- if (!lsn) {
-
- lsn = log_sys.get_lsn();
- }
-
- return(lsn);
+ return lsn ? lsn : log_sys.get_lsn();
}
/** Extends the log buffer.