summaryrefslogtreecommitdiff
path: root/innobase/log
diff options
context:
space:
mode:
Diffstat (limited to 'innobase/log')
-rw-r--r--innobase/log/log0log.c45
-rw-r--r--innobase/log/log0recv.c18
2 files changed, 49 insertions, 14 deletions
diff --git a/innobase/log/log0log.c b/innobase/log/log0log.c
index beac63535ab..3213866e8a7 100644
--- a/innobase/log/log0log.c
+++ b/innobase/log/log0log.c
@@ -569,9 +569,12 @@ log_init(void)
ut_a(LOG_BUFFER_SIZE >= 4 * UNIV_PAGE_SIZE);
buf = ut_malloc(LOG_BUFFER_SIZE + OS_FILE_LOG_BLOCK_SIZE);
- log_sys->buf = ut_align(buf, OS_FILE_LOG_BLOCK_SIZE);
+ log_sys->buf = ut_align(buf, OS_FILE_LOG_BLOCK_SIZE);
log_sys->buf_size = LOG_BUFFER_SIZE;
+
+ memset(log_sys->buf, '\0', LOG_BUFFER_SIZE);
+
log_sys->max_buf_free = log_sys->buf_size / LOG_BUF_FLUSH_RATIO
- LOG_BUF_FLUSH_MARGIN;
log_sys->check_flush_or_checkpoint = TRUE;
@@ -579,6 +582,8 @@ log_init(void)
log_sys->n_log_ios = 0;
+ log_sys->n_log_ios_old = log_sys->n_log_ios;
+ log_sys->last_printout_time = time(NULL);
/*----------------------------*/
log_sys->buf_next_to_write = 0;
@@ -609,6 +614,7 @@ log_init(void)
log_sys->checkpoint_buf = ut_align(
mem_alloc(2 * OS_FILE_LOG_BLOCK_SIZE),
OS_FILE_LOG_BLOCK_SIZE);
+ memset(log_sys->checkpoint_buf, '\0', OS_FILE_LOG_BLOCK_SIZE);
/*----------------------------*/
log_sys->archiving_state = LOG_ARCH_ON;
@@ -626,6 +632,8 @@ log_init(void)
OS_FILE_LOG_BLOCK_SIZE);
log_sys->archive_buf_size = LOG_ARCHIVE_BUF_SIZE;
+ memset(log_sys->archive_buf, '\0', LOG_ARCHIVE_BUF_SIZE);
+
log_sys->archiving_on = os_event_create(NULL);
/*----------------------------*/
@@ -2791,8 +2799,35 @@ void
log_print(void)
/*===========*/
{
- printf("Log sequence number %lu %lu\n",
- ut_dulint_get_high(log_sys->lsn),
- ut_dulint_get_low(log_sys->lsn));
-}
+ double time_elapsed;
+ time_t current_time;
+
+ mutex_enter(&(log_sys->mutex));
+ printf("Log sequence number %lu %lu\n"
+ "Log flushed up to %lu %lu\n"
+ "Last checkpoint at %lu %lu\n",
+ ut_dulint_get_high(log_sys->lsn),
+ ut_dulint_get_low(log_sys->lsn),
+ ut_dulint_get_high(log_sys->written_to_some_lsn),
+ ut_dulint_get_low(log_sys->written_to_some_lsn),
+ ut_dulint_get_high(log_sys->last_checkpoint_lsn),
+ ut_dulint_get_low(log_sys->last_checkpoint_lsn));
+
+ current_time = time(NULL);
+
+ time_elapsed = difftime(current_time, log_sys->last_printout_time);
+
+ printf(
+ "%lu pending log writes, %lu pending chkp writes\n"
+ "%lu log i/o's done, %.2f log i/o's/second\n",
+ log_sys->n_pending_writes,
+ log_sys->n_pending_checkpoint_writes,
+ log_sys->n_log_ios,
+ (log_sys->n_log_ios - log_sys->n_log_ios_old) / time_elapsed);
+
+ log_sys->n_log_ios_old = log_sys->n_log_ios;
+ log_sys->last_printout_time = current_time;
+
+ mutex_exit(&(log_sys->mutex));
+}
diff --git a/innobase/log/log0recv.c b/innobase/log/log0recv.c
index edab98fa39c..eb3eadcede9 100644
--- a/innobase/log/log0recv.c
+++ b/innobase/log/log0recv.c
@@ -560,6 +560,7 @@ recv_parse_or_apply_log_rec_body(
} else if (type <= MLOG_WRITE_STRING) {
new_ptr = mlog_parse_string(ptr, end_ptr, page);
} else {
+ new_ptr = NULL; /* Eliminate compiler warning */
ut_error;
}
@@ -801,9 +802,7 @@ recv_recover_page(
mtr_set_log_mode(&mtr, MTR_LOG_NONE);
success = buf_page_get_known_nowait(RW_X_LATCH, page, BUF_KEEP_OLD,
-#ifdef UNIV_SYNC_DEBUG
IB__FILE__, __LINE__,
-#endif
&mtr);
ut_a(success);
@@ -1212,9 +1211,7 @@ recv_compare_spaces(
frame = buf_page_get_gen(space1, page_no, RW_S_LATCH, NULL,
BUF_GET_IF_IN_POOL,
-#ifdef UNIV_SYNC_DEBUG
IB__FILE__, __LINE__,
-#endif
&mtr);
if (frame) {
buf_page_dbg_add_level(frame, SYNC_NO_ORDER_CHECK);
@@ -1227,9 +1224,7 @@ recv_compare_spaces(
frame = buf_page_get_gen(space2, page_no, RW_S_LATCH, NULL,
BUF_GET_IF_IN_POOL,
-#ifdef UNIV_SYNC_DEBUG
IB__FILE__, __LINE__,
-#endif
&mtr);
if (frame) {
buf_page_dbg_add_level(frame, SYNC_NO_ORDER_CHECK);
@@ -2033,8 +2028,11 @@ recv_recovery_from_checkpoint_start(
while (group) {
old_scanned_lsn = recv_sys->scanned_lsn;
- recv_group_scan_log_recs(group, &contiguous_lsn,
+ if (srv_force_recovery < SRV_FORCE_NO_LOG_REDO) {
+ recv_group_scan_log_recs(group, &contiguous_lsn,
&group_scanned_lsn);
+ }
+
group->scanned_lsn = group_scanned_lsn;
if (ut_dulint_cmp(old_scanned_lsn, group_scanned_lsn) < 0) {
@@ -2120,10 +2118,12 @@ recv_recovery_from_checkpoint_finish(void)
{
/* Rollback the uncommitted transactions which have no user session */
- trx_rollback_all_without_sess();
+ if (srv_force_recovery < SRV_FORCE_NO_TRX_UNDO) {
+ trx_rollback_all_without_sess();
+ }
/* Apply the hashed log records to the respective file pages */
-
+
recv_apply_hashed_log_recs(TRUE);
if (log_debug_writes) {