summaryrefslogtreecommitdiff
path: root/innobase/log/log0log.c
diff options
context:
space:
mode:
Diffstat (limited to 'innobase/log/log0log.c')
-rw-r--r--innobase/log/log0log.c54
1 files changed, 53 insertions, 1 deletions
diff --git a/innobase/log/log0log.c b/innobase/log/log0log.c
index cd2b6f520b0..256de701c0f 100644
--- a/innobase/log/log0log.c
+++ b/innobase/log/log0log.c
@@ -140,7 +140,9 @@ log_buf_pool_get_oldest_modification(void)
{
dulint lsn;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
lsn = buf_pool_get_oldest_modification();
@@ -239,7 +241,9 @@ log_write_low(
ulint data_len;
byte* log_block;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
part_loop:
/* Calculate a part length */
@@ -306,7 +310,9 @@ log_close(void)
log_t* log = log_sys;
ulint checkpoint_age;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
lsn = log->lsn;
@@ -421,7 +427,9 @@ log_group_get_capacity(
/* out: capacity in bytes */
log_group_t* group) /* in: log group */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
return((group->file_size - LOG_FILE_HDR_SIZE) * group->n_files);
}
@@ -437,7 +445,9 @@ log_group_calc_size_offset(
ulint offset, /* in: real offset within the log group */
log_group_t* group) /* in: log group */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
return(offset - LOG_FILE_HDR_SIZE * (1 + offset / group->file_size));
}
@@ -453,7 +463,9 @@ log_group_calc_real_offset(
ulint offset, /* in: size offset within the log group */
log_group_t* group) /* in: log group */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
return(offset + LOG_FILE_HDR_SIZE
* (1 + offset / (group->file_size - LOG_FILE_HDR_SIZE)));
@@ -475,7 +487,9 @@ log_group_calc_lsn_offset(
ib_longlong group_size;
ib_longlong offset;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
/* If total log file size is > 2 GB we can easily get overflows
with 32-bit integers. Use 64-bit integers instead. */
@@ -589,7 +603,9 @@ log_calc_max_ages(void)
ulint archive_margin;
ulint smallest_archive_margin;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(!mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
mutex_enter(&(log_sys->mutex));
@@ -876,7 +892,9 @@ log_flush_do_unlocks(
ulint code) /* in: any ORed combination of LOG_UNLOCK_FLUSH_LOCK
and LOG_UNLOCK_NONE_FLUSHED_LOCK */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
/* NOTE that we must own the log mutex when doing the setting of the
events: this is because transactions will wait for these events to
@@ -908,7 +926,9 @@ log_group_check_flush_completion(
/* out: LOG_UNLOCK_NONE_FLUSHED_LOCK or 0 */
log_group_t* group) /* in: log group */
{
- ut_ad(mutex_own(&(log_sys->mutex)));
+#ifdef UNIV_SYNC_DEBUG
+ ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
if (!log_sys->one_flushed && group->n_pending_writes == 0) {
@@ -941,7 +961,9 @@ log_sys_check_flush_completion(void)
ulint move_start;
ulint move_end;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
if (log_sys->n_pending_writes == 0) {
@@ -1048,7 +1070,9 @@ log_group_file_header_flush(
UT_NOT_USED(type);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_a(nth_file < group->n_files);
@@ -1116,7 +1140,9 @@ log_group_write_buf(
ulint next_offset;
ulint i;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_a(len % OS_FILE_LOG_BLOCK_SIZE == 0);
ut_a(ut_dulint_get_low(start_lsn) % OS_FILE_LOG_BLOCK_SIZE == 0);
@@ -1513,7 +1539,9 @@ void
log_complete_checkpoint(void)
/*=========================*/
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(log_sys->n_pending_checkpoint_writes == 0);
log_sys->next_checkpoint_no
@@ -1603,7 +1631,9 @@ log_group_checkpoint(
byte* buf;
ulint i;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_a(LOG_CHECKPOINT_SIZE <= OS_FILE_LOG_BLOCK_SIZE);
buf = group->checkpoint_buf;
@@ -1757,7 +1787,9 @@ log_group_read_checkpoint_info(
log_group_t* group, /* in: log group */
ulint field) /* in: LOG_CHECKPOINT_1 or LOG_CHECKPOINT_2 */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
log_sys->n_log_ios++;
@@ -1775,7 +1807,9 @@ log_groups_write_checkpoint_info(void)
{
log_group_t* group;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
group = UT_LIST_GET_FIRST(log_sys->log_groups);
@@ -2040,7 +2074,9 @@ log_group_read_log_seg(
ulint source_offset;
ibool sync;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
sync = FALSE;
@@ -2110,7 +2146,9 @@ log_group_archive_file_header_write(
byte* buf;
ulint dest_offset;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_a(nth_file < group->n_files);
@@ -2147,7 +2185,9 @@ log_group_archive_completed_header_write(
byte* buf;
ulint dest_offset;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_a(nth_file < group->n_files);
buf = *(group->archive_file_header_bufs + nth_file);
@@ -2186,7 +2226,9 @@ log_group_archive(
ulint n_files;
ulint open_mode;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
start_lsn = log_sys->archived_lsn;
@@ -2314,7 +2356,9 @@ log_archive_groups(void)
{
log_group_t* group;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
group = UT_LIST_GET_FIRST(log_sys->log_groups);
@@ -2337,7 +2381,9 @@ log_archive_write_complete_groups(void)
dulint end_lsn;
ulint i;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
group = UT_LIST_GET_FIRST(log_sys->log_groups);
@@ -2399,7 +2445,9 @@ void
log_archive_check_completion_low(void)
/*==================================*/
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
if (log_sys->n_pending_archive_ios == 0
&& log_sys->archiving_phase == LOG_ARCHIVE_READ) {
@@ -2630,7 +2678,9 @@ log_archive_close_groups(
log_group_t* group;
ulint trunc_len;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
group = UT_LIST_GET_FIRST(log_sys->log_groups);
@@ -3124,7 +3174,9 @@ log_check_log_recs(
byte* buf1;
byte* scan_buf;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
if (len == 0) {